@rancher/shell 3.0.12-rc.2 → 3.0.12-rc.4
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/apis/impl/apis.ts +6 -0
- package/apis/index.ts +26 -0
- package/apis/intf/resources-api/cluster-api.ts +18 -0
- package/apis/intf/resources-api/mgmt-api.ts +15 -0
- package/apis/intf/resources-api/resource-base.ts +107 -0
- package/apis/intf/resources-api/resource-constants.ts +147 -0
- package/apis/intf/resources-api/resources-api.ts +143 -0
- package/apis/intf/resources.ts +49 -0
- package/apis/intf/{modal.ts → shell-api/modal.ts} +21 -26
- package/apis/intf/shell-api/proxy.ts +216 -0
- package/apis/intf/{slide-in.ts → shell-api/slide-in.ts} +4 -3
- package/apis/intf/{system.ts → shell-api/system.ts} +4 -1
- package/apis/intf/shell.ts +12 -6
- package/apis/resources/__tests__/resources-api-class.test.ts +550 -0
- package/apis/resources/index.ts +22 -0
- package/apis/resources/resources-api-class.ts +187 -0
- package/apis/shell/__tests__/proxy.test.ts +369 -0
- package/apis/shell/index.ts +8 -1
- package/apis/shell/modal.ts +4 -1
- package/apis/shell/notifications.ts +9 -6
- package/apis/shell/proxy.ts +256 -0
- package/apis/shell/slide-in.ts +4 -1
- package/apis/vue-shim.d.ts +2 -1
- package/assets/data/aws-regions.json +4 -0
- package/assets/fonts/lato/LatoLatin-Black.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Black.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-BlackItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-BlackItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Bold.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Bold.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-BoldItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-BoldItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Heavy.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Heavy.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-HeavyItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-HeavyItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Italic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Italic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Light.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Light.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-LightItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-LightItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Medium.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Medium.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-MediumItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-MediumItalic.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Regular.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Regular.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-Semibold.woff +0 -0
- package/assets/fonts/lato/LatoLatin-Semibold.woff2 +0 -0
- package/assets/fonts/lato/LatoLatin-SemiboldItalic.woff +0 -0
- package/assets/fonts/lato/LatoLatin-SemiboldItalic.woff2 +0 -0
- package/assets/styles/base/_variables.scss +2 -0
- package/assets/styles/fonts/_fontstack.scss +132 -8
- package/assets/styles/global/_layout.scss +4 -0
- package/assets/translations/en-us.yaml +165 -45
- package/assets/translations/zh-hans.yaml +1 -7
- package/chart/monitoring/ClusterSelector.vue +0 -21
- package/chart/monitoring/index.vue +10 -1
- package/chart/monitoring/prometheus/index.vue +6 -3
- package/components/ActionDropdownShell.vue +2 -1
- package/components/CruResource.vue +161 -14
- package/components/CruResourceFooter.vue +9 -5
- package/components/ExplorerMembers.vue +8 -4
- package/components/ExplorerProjectsNamespaces.vue +11 -7
- package/components/GrowlManager.vue +4 -0
- package/components/InstallHelmCharts.vue +2 -2
- package/components/LandingPagePreference.vue +14 -5
- package/components/MgmtNodeList.vue +184 -0
- package/components/Resource/Detail/Card/StateCard/__tests__/composables.test.ts +90 -1
- package/components/Resource/Detail/Card/StateCard/composables.ts +57 -87
- package/components/Resource/Detail/Card/StatusCard/__tests__/StatusCard.test.ts +61 -0
- package/components/Resource/Detail/Card/StatusCard/index.vue +61 -15
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +17 -1
- package/components/Resource/Detail/Metadata/KeyValue.vue +5 -2
- package/components/Resource/Detail/Metadata/KeyValueRow.vue +2 -6
- package/components/Resource/Detail/Metadata/index.vue +6 -0
- package/components/Resource/Detail/ResourcePopover/index.vue +12 -1
- package/components/Resource/Detail/SpacedRow.vue +3 -1
- package/components/Resource/Detail/TitleBar/index.vue +10 -11
- package/components/ResourceDetail/index.vue +1 -1
- package/components/ResourceList/Masthead.vue +19 -9
- package/components/ResourceList/index.vue +82 -1
- package/components/RichTranslation.vue +5 -2
- package/components/SelectIconGrid.vue +0 -10
- package/components/Setting.vue +1 -0
- package/components/SingleClusterInfo.vue +1 -0
- package/components/SortableTable/__tests__/sorting.test.ts +126 -0
- package/components/SortableTable/index.vue +6 -9
- package/components/SortableTable/selection.js +23 -5
- package/components/SortableTable/sorting.js +6 -3
- package/components/SubtleLink.vue +31 -6
- package/components/Tabbed/Tab.vue +29 -3
- package/components/Tabbed/index.vue +25 -3
- package/components/TableOfContents/TableOfContents.vue +109 -0
- package/components/TableOfContents/composables.ts +258 -0
- package/components/Window/ContainerShell.vue +21 -11
- package/components/Window/__tests__/ContainerShell.test.ts +107 -37
- package/components/Wizard.vue +23 -17
- package/components/fleet/AppCoChartGrid.vue +401 -0
- package/components/fleet/AppCoEmptyState.vue +127 -0
- package/components/fleet/AppCoPageHeader.vue +119 -0
- package/components/fleet/AppCoVersionSelect.vue +70 -0
- package/components/fleet/FleetBundles.vue +100 -12
- package/components/fleet/FleetClusterTargets/ClusterSelectionFields.vue +217 -0
- package/components/fleet/FleetClusterTargets/TargetsList.vue +123 -35
- package/components/fleet/FleetClusterTargets/index.vue +226 -161
- package/components/fleet/FleetIntro.vue +7 -3
- package/components/fleet/FleetNoWorkspaces.vue +7 -3
- package/components/fleet/FleetSecretSelector.vue +5 -3
- package/components/fleet/FleetValuesFrom.vue +8 -2
- package/components/fleet/GitRepoTargetTab.vue +0 -2
- package/components/fleet/HelmOpAdvancedTab.vue +19 -53
- package/components/fleet/HelmOpAppCoConfigTab.vue +593 -0
- package/components/fleet/HelmOpAppCoResourcesSection.vue +162 -0
- package/components/fleet/HelmOpResourcesSection.vue +82 -0
- package/components/fleet/HelmOpTargetOptionsSection.vue +89 -0
- package/components/fleet/HelmOpTargetTab.vue +64 -60
- package/components/fleet/HelmOpValuesTab.vue +129 -105
- package/components/fleet/__tests__/AppCoEmptyState.test.ts +71 -0
- package/components/fleet/__tests__/AppCoVersionSelect.test.ts +36 -0
- package/components/fleet/__tests__/ClusterSelectionFields.test.ts +62 -0
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +402 -115
- package/components/fleet/__tests__/FleetClusters.test.ts +12 -12
- package/components/fleet/__tests__/FleetSecretSelector.test.ts +16 -0
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +44 -0
- package/components/fleet/__tests__/HelmOpAppCoConfigTab.test.ts +59 -0
- package/components/fleet/__tests__/HelmOpAppCoResourcesSection.test.ts +62 -0
- package/components/fleet/__tests__/HelmOpResourcesSection.test.ts +43 -0
- package/components/fleet/__tests__/HelmOpTargetOptionsSection.test.ts +34 -0
- package/components/fleet/__tests__/HelmOpValuesTab.test.ts +39 -0
- package/components/fleet/__tests__/__snapshots__/AppCoEmptyState.test.ts.snap +97 -0
- package/components/fleet/__tests__/__snapshots__/AppCoVersionSelect.test.ts.snap +30 -0
- package/components/fleet/__tests__/__snapshots__/ClusterSelectionFields.test.ts.snap +209 -0
- package/components/fleet/__tests__/__snapshots__/HelmOpTargetOptionsSection.test.ts.snap +140 -0
- package/components/fleet/dashboard/Empty.vue +8 -4
- package/components/fleet/dashboard/ResourceCard.vue +28 -0
- package/components/fleet/dashboard/ResourceDetails.vue +28 -0
- package/components/fleet/dashboard/__tests__/ResourceCard.test.ts +87 -0
- package/components/form/ArrayList.vue +61 -4
- package/components/form/KeyValue.vue +23 -2
- package/components/form/LabeledSelect.vue +59 -4
- package/components/form/Labels.vue +22 -3
- package/components/form/NameNsDescription.vue +24 -5
- package/components/form/ResourceTabs/index.vue +1 -0
- package/components/form/Security.vue +6 -2
- package/components/form/WorkloadPorts.vue +2 -7
- package/components/form/__tests__/NameNsDescription.test.ts +75 -0
- package/components/form/__tests__/Security.test.ts +76 -0
- package/components/formatter/Autoscaler.vue +4 -4
- package/components/formatter/ClusterKubeVersion.vue +27 -0
- package/components/formatter/ClusterLink.vue +1 -7
- package/components/formatter/ClusterProvider.vue +6 -10
- package/components/formatter/FleetSummaryGraph.vue +0 -3
- package/components/formatter/InternalExternalIP.vue +10 -4
- package/components/formatter/MachineSummaryGraph.vue +1 -1
- package/components/formatter/PodsUsage.vue +2 -2
- package/components/formatter/ServiceTargets.vue +26 -7
- package/components/formatter/__tests__/Autoscaler.test.ts +19 -22
- package/components/formatter/__tests__/FleetSummaryGraph.test.ts +216 -0
- package/components/formatter/__tests__/InternalExternalIP.test.ts +132 -0
- package/components/formatter/__tests__/PodsUsage.test.ts +6 -10
- package/components/formatter/__tests__/ServiceTargets.test.ts +412 -0
- package/components/nav/Header.vue +4 -0
- package/components/nav/NamespaceFilter.vue +2 -2
- package/components/nav/TopLevelMenu.helper.ts +15 -3
- package/components/nav/TopLevelMenu.vue +22 -6
- package/components/nav/__tests__/Header.test.ts +15 -0
- package/components/nav/__tests__/TopLevelMenu.test.ts +263 -21
- package/components/templates/default.vue +9 -4
- package/components/templates/home.vue +23 -0
- package/components/templates/plain.vue +23 -0
- package/components/templates/standalone.vue +17 -0
- package/composables/useFormValidation.ts +93 -0
- package/composables/useHelmOpResources.test.ts +56 -0
- package/composables/useHelmOpResources.ts +32 -0
- package/composables/useStateColor.test.ts +325 -0
- package/composables/useStateColor.ts +128 -0
- package/composables/useVeeValidateField.test.ts +159 -0
- package/composables/useVeeValidateField.ts +67 -0
- package/config/home-links.js +1 -1
- package/config/labels-annotations.js +1 -0
- package/config/pagination-table-headers.js +18 -1
- package/config/product/explorer.js +17 -4
- package/config/product/manager.js +84 -21
- package/config/router/index.js +16 -0
- package/config/router/navigation-guards/__tests__/authentication.test.ts +130 -0
- package/config/router/navigation-guards/authentication.js +10 -4
- package/config/router/routes.js +26 -6
- package/config/settings.ts +0 -2
- package/config/table-headers.js +23 -5
- package/config/types.js +11 -1
- package/core/__tests__/plugin-products.test.ts +904 -20
- package/core/plugin-products-base.ts +110 -10
- package/core/plugin-products.ts +4 -0
- package/core/plugin-types.ts +194 -31
- package/core/plugin.ts +18 -7
- package/core/productDebugger.js +9 -4
- package/core/types-provisioning.ts +77 -31
- package/core/types.ts +72 -22
- package/detail/__tests__/pod.test.ts +41 -0
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +114 -0
- package/detail/__tests__/workload.test.ts +3 -152
- package/detail/catalog.cattle.io.clusterrepo.vue +1 -1
- package/detail/harvesterhci.io.management.cluster.vue +6 -2
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +34 -14
- package/detail/workload/index.vue +12 -55
- package/edit/__tests__/catalog.cattle.io.clusterrepo.test.ts +248 -0
- package/edit/__tests__/fleet.cattle.io.helmop.test.ts +105 -0
- package/edit/auditlog.cattle.io.auditpolicy/__tests__/__snapshots__/General.test.ts.snap +6 -0
- package/edit/auditlog.cattle.io.auditpolicy/__tests__/__snapshots__/index.test.ts.snap +1 -0
- package/edit/auth/__tests__/azuread.test.ts +247 -39
- package/edit/auth/__tests__/github.test.ts +234 -0
- package/edit/auth/__tests__/oidc.test.ts +26 -6
- package/edit/auth/__tests__/saml.test.ts +196 -0
- package/edit/auth/azuread.vue +197 -56
- package/edit/auth/github.vue +72 -13
- package/edit/auth/ldap/__tests__/index.test.ts +206 -0
- package/edit/auth/ldap/config.vue +8 -0
- package/edit/auth/ldap/index.vue +75 -1
- package/edit/auth/oidc.vue +119 -73
- package/edit/auth/saml.vue +76 -12
- package/edit/catalog.cattle.io.clusterrepo.vue +140 -32
- package/edit/fleet.cattle.io.helmop.vue +491 -136
- package/edit/management.cattle.io.user.vue +5 -2
- package/edit/networking.k8s.io.ingress/DefaultBackend.vue +13 -4
- package/edit/networking.k8s.io.ingress/RulePath.vue +8 -4
- package/edit/networking.k8s.io.ingress/index.vue +75 -20
- package/edit/provisioning.cattle.io.cluster/__tests__/MachinePool.test.ts +104 -0
- package/edit/provisioning.cattle.io.cluster/index.vue +11 -7
- package/edit/provisioning.cattle.io.cluster/rke2.vue +92 -14
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +22 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +37 -4
- package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +132 -7
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +2 -1
- package/edit/secret/__tests__/ssh.test.ts +5 -6
- package/edit/secret/basic.vue +31 -0
- package/edit/secret/index.vue +68 -17
- package/edit/secret/registry.vue +38 -0
- package/edit/secret/ssh.vue +29 -0
- package/edit/secret/tls.vue +30 -0
- package/edit/service.vue +4 -4
- package/edit/workload/Upgrading.vue +3 -3
- package/edit/workload/__tests__/Upgrading.test.ts +6 -9
- package/edit/workload/mixins/workload.js +2 -1
- package/list/fleet.cattle.io.bundle.vue +7 -104
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +20 -0
- package/list/group.principal.vue +5 -4
- package/list/harvesterhci.io.management.cluster.vue +8 -9
- package/list/management.cattle.io.user.vue +12 -9
- package/list/provisioning.cattle.io.cluster.vue +268 -180
- package/list/utils/management.cattle.io.cluster.utils.ts +128 -0
- package/mixins/__tests__/auth-config.test.ts +90 -0
- package/mixins/__tests__/chart.test.ts +206 -0
- package/mixins/__tests__/resource-fetch-api-pagination.test.ts +48 -0
- package/mixins/auth-config.js +7 -0
- package/mixins/brand.js +2 -1
- package/mixins/chart.js +22 -9
- package/mixins/child-hook.js +12 -6
- package/mixins/create-edit-view/impl.js +5 -3
- package/mixins/resource-fetch-api-pagination.js +62 -6
- package/models/__tests__/catalog.cattle.io.clusterrepo.test.ts +57 -0
- package/models/__tests__/compliance.cattle.io.clusterscan.test.ts +144 -0
- package/models/__tests__/ext.cattle.io.kubeconfig.test.ts +67 -67
- package/models/__tests__/fleet-application.test.ts +175 -0
- package/models/__tests__/fleet.cattle.io.bundle.test.ts +169 -0
- package/models/__tests__/fleet.cattle.io.helmop.test.ts +84 -0
- package/models/__tests__/management.cattle.io.cluster.test.ts +1 -1
- package/models/__tests__/management.cattle.io.node.ts +28 -5
- package/models/__tests__/management.cattle.io.nodepool.ts +5 -4
- package/models/__tests__/namespace.test.ts +36 -0
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +81 -11
- package/models/__tests__/workload.test.ts +401 -26
- package/models/base-cluster.x-k8s.io.js +26 -0
- package/models/catalog.cattle.io.clusterrepo.js +28 -4
- package/models/cluster.js +1 -1
- package/models/cluster.x-k8s.io.machine.js +4 -22
- package/models/cluster.x-k8s.io.machinedeployment.js +2 -20
- package/models/cluster.x-k8s.io.machineset.js +2 -20
- package/models/compliance.cattle.io.clusterscan.js +165 -2
- package/models/ext.cattle.io.kubeconfig.ts +4 -7
- package/models/fleet-application.js +7 -1
- package/models/fleet.cattle.io.helmop.js +20 -1
- package/models/management.cattle.io.cluster.js +434 -41
- package/models/management.cattle.io.node.js +50 -7
- package/models/management.cattle.io.nodepool.js +1 -1
- package/models/namespace.js +1 -1
- package/models/networking.k8s.io.ingress.js +12 -4
- package/models/pod.js +33 -1
- package/models/provisioning.cattle.io.cluster.js +51 -334
- package/models/rke.cattle.io.etcdsnapshot.js +1 -2
- package/models/workload.js +108 -13
- package/models/workload.service.js +5 -0
- package/package.json +22 -39
- package/pages/__tests__/readme.test.ts +49 -0
- package/pages/about.vue +5 -6
- package/pages/auth/login.vue +0 -35
- package/pages/auth/setup.vue +13 -3
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +2 -2
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +10 -1
- package/pages/c/_cluster/apps/charts/__tests__/chart.test.ts +76 -0
- package/pages/c/_cluster/apps/charts/__tests__/index.test.ts +93 -0
- package/pages/c/_cluster/apps/charts/chart.vue +62 -9
- package/pages/c/_cluster/apps/charts/index.vue +48 -10
- package/pages/c/_cluster/apps/charts/install.vue +122 -113
- package/pages/c/_cluster/auth/roles/index.vue +5 -4
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +23 -25
- package/pages/c/_cluster/explorer/index.vue +5 -49
- package/pages/c/_cluster/explorer/workload-dashboard/ByNamespaceSection.vue +31 -0
- package/pages/c/_cluster/explorer/workload-dashboard/ByStateSection.vue +138 -0
- package/pages/c/_cluster/explorer/workload-dashboard/ByTypeSection.vue +30 -0
- package/pages/c/_cluster/explorer/workload-dashboard/WorkloadCard.vue +155 -0
- package/pages/c/_cluster/explorer/workload-dashboard/WorkloadNamespaceCard.vue +142 -0
- package/pages/c/_cluster/explorer/workload-dashboard/WorkloadTypeCard.vue +159 -0
- package/pages/c/_cluster/explorer/workload-dashboard/__tests__/composable.test.ts +561 -0
- package/pages/c/_cluster/explorer/workload-dashboard/composable.ts +440 -0
- package/pages/c/_cluster/explorer/workload-dashboard/index.vue +187 -0
- package/pages/c/_cluster/explorer/workload-dashboard/types.ts +80 -0
- package/pages/c/_cluster/fleet/application/create.vue +187 -136
- package/pages/c/_cluster/fleet/application/index.vue +5 -3
- package/pages/c/_cluster/fleet/application/suse-app-collection/ChartDetailBody.vue +338 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/ChartDetailHeader.vue +121 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/chart.vue +369 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/charts.vue +248 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/credentials.vue +310 -0
- package/pages/c/_cluster/fleet/index.vue +2 -2
- package/pages/c/_cluster/istio/__tests__/istio.index.test.ts +194 -0
- package/pages/c/_cluster/istio/index.vue +21 -6
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -0
- package/pages/c/_cluster/uiplugins/__tests__/index.test.ts +815 -2
- package/pages/c/_cluster/uiplugins/index.vue +218 -197
- package/pages/diagnostic.vue +13 -17
- package/pages/fail-whale.vue +30 -7
- package/pages/home.vue +93 -306
- package/pages/readme.vue +88 -0
- package/plugins/clean-html.d.ts +9 -0
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +181 -0
- package/plugins/dashboard-store/actions.js +40 -18
- package/plugins/dashboard-store/resource-class.js +67 -9
- package/plugins/steve/__tests__/actions.test.ts +212 -0
- package/plugins/steve/__tests__/subscribe.spec.ts +6 -3
- package/plugins/steve/actions.js +96 -0
- package/plugins/steve/steve-pagination-utils.ts +12 -4
- package/plugins/steve/subscribe.js +35 -5
- package/rancher-components/Accordion/Accordion.vue +53 -9
- package/rancher-components/Form/Checkbox/Checkbox.vue +14 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +10 -4
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +7 -52
- package/rancher-components/Form/Radio/RadioButton.vue +17 -1
- package/rancher-components/Form/Radio/RadioGroup.vue +10 -0
- package/rancher-components/Pill/RcTag/RcTag.vue +3 -2
- package/rancher-components/RcButton/RcButton.test.ts +140 -1
- package/rancher-components/RcButton/RcButton.vue +126 -17
- package/rancher-components/RcButton/types.ts +3 -0
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +10 -8
- package/rancher-components/RcItemCard/RcItemCard.test.ts +18 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +2 -2
- package/rancher-components/RcSection/RcSection.vue +28 -3
- package/scripts/extension/helm/package/Dockerfile +1 -1
- package/scripts/test-plugins-build.sh +2 -1
- package/store/__tests__/catalog.test.ts +115 -1
- package/store/__tests__/notifications.test.ts +434 -0
- package/store/__tests__/type-map.test.ts +556 -1
- package/store/action-menu.js +8 -3
- package/store/auth.js +1 -1
- package/store/aws.js +27 -16
- package/store/catalog.js +84 -3
- package/store/digitalocean.js +20 -38
- package/store/index.js +2 -0
- package/store/linode.js +25 -40
- package/store/plugins.js +7 -4
- package/store/pnap.js +1 -0
- package/store/type-map.js +111 -29
- package/tsconfig.paths.json +8 -8
- package/types/components/buttonGroup.ts +5 -0
- package/types/kube/kube-api.ts +14 -1
- package/types/rancher/steve.api.ts +12 -12
- package/types/resources/settings.d.ts +2 -1
- package/types/shell/index.d.ts +206 -72
- package/types/store/dashboard-store.types.ts +108 -11
- package/types/store/pagination.types.ts +6 -3
- package/utils/__tests__/alertmanagerconfig.test.ts +117 -0
- package/utils/__tests__/async.test.ts +87 -0
- package/utils/__tests__/auth.test.ts +273 -0
- package/utils/__tests__/aws.test.ts +140 -0
- package/utils/__tests__/banners.test.ts +176 -0
- package/utils/__tests__/chart.test.ts +64 -1
- package/utils/__tests__/color.test.ts +226 -0
- package/utils/__tests__/computed.test.ts +193 -0
- package/utils/__tests__/cspAdaptor.test.ts +163 -0
- package/utils/__tests__/dom.test.ts +81 -0
- package/utils/__tests__/duration.test.ts +176 -0
- package/utils/__tests__/dynamic-importer.test.ts +102 -0
- package/utils/__tests__/fleet-appco.test.ts +312 -0
- package/utils/__tests__/fleet.test.ts +340 -0
- package/utils/__tests__/ingress.test.ts +553 -0
- package/utils/__tests__/kube.test.ts +68 -0
- package/utils/__tests__/monitoring.test.ts +130 -0
- package/utils/__tests__/namespace-filter.test.ts +109 -0
- package/utils/__tests__/object.test.ts +22 -0
- package/utils/__tests__/pagination-utils.test.ts +361 -0
- package/utils/__tests__/parse-externalid.test.ts +137 -0
- package/utils/__tests__/perf-setting.utils.test.ts +98 -0
- package/utils/__tests__/platform.test.ts +91 -0
- package/utils/__tests__/poller-sequential.test.ts +177 -0
- package/utils/__tests__/poller.test.ts +170 -0
- package/utils/__tests__/position.test.ts +237 -0
- package/utils/__tests__/promise.test.ts +346 -0
- package/utils/__tests__/provider.test.ts +51 -1
- package/utils/__tests__/queue.test.ts +232 -0
- package/utils/__tests__/release-notes.test.ts +221 -0
- package/utils/__tests__/router.test.js +254 -1
- package/utils/__tests__/select.test.ts +208 -0
- package/utils/__tests__/settings.test.ts +140 -0
- package/utils/__tests__/sort-utils.test.ts +301 -0
- package/utils/__tests__/string-utils.test.ts +798 -0
- package/utils/__tests__/string.test.ts +23 -1
- package/utils/__tests__/style.test.ts +154 -0
- package/utils/__tests__/svg-filter.test.ts +184 -0
- package/utils/__tests__/time.test.ts +265 -1
- package/utils/__tests__/title.test.ts +47 -0
- package/utils/__tests__/units.test.ts +417 -0
- package/utils/__tests__/versions.test.ts +128 -0
- package/utils/__tests__/width.test.ts +53 -0
- package/utils/__tests__/window.test.ts +158 -0
- package/utils/__tests__/xccdf.test.ts +511 -0
- package/utils/chart.js +36 -0
- package/utils/crypto/__tests__/browserHashUtils.test.ts +98 -0
- package/utils/crypto/__tests__/index.test.ts +144 -0
- package/utils/duration.ts +104 -0
- package/utils/dynamic-content/__tests__/notification-handler.test.ts +196 -0
- package/utils/dynamic-content/info.ts +2 -1
- package/utils/error.js +13 -0
- package/utils/fleet-appco.ts +323 -0
- package/utils/fleet.ts +13 -3
- package/utils/gatekeeper/__tests__/util.test.ts +174 -0
- package/utils/gc/__tests__/gc-interval.test.ts +119 -0
- package/utils/gc/__tests__/gc-root-store.test.ts +225 -0
- package/utils/gc/__tests__/gc-route-changed.test.ts +96 -0
- package/utils/gc/__tests__/gc.test.ts +487 -0
- package/utils/ingress.ts +9 -1
- package/utils/object.js +22 -2
- package/utils/pagination-utils.ts +2 -1
- package/utils/provider.ts +12 -0
- package/utils/string.js +25 -2
- package/utils/uiplugins.ts +5 -5
- package/utils/validators/__tests__/cluster-name.test.ts +110 -0
- package/utils/validators/__tests__/container-images.test.ts +104 -0
- package/utils/validators/__tests__/cron-schedule.test.ts +79 -0
- package/utils/validators/__tests__/flow-output.test.ts +91 -0
- package/utils/validators/__tests__/index.test.ts +481 -0
- package/utils/validators/__tests__/kubernetes-name.test.ts +163 -0
- package/utils/validators/__tests__/logging-outputs.test.ts +58 -0
- package/utils/validators/__tests__/misc-validators.test.ts +246 -0
- package/utils/validators/__tests__/monitoring-route.test.ts +119 -0
- package/utils/validators/__tests__/pod-affinity.test.ts +382 -0
- package/utils/validators/__tests__/prometheusrule.test.ts +211 -0
- package/utils/validators/__tests__/role-template.test.ts +149 -0
- package/utils/validators/__tests__/service.test.ts +283 -0
- package/utils/validators/__tests__/setting.test.js +32 -0
- package/utils/validators/formRules/__tests__/index.test.ts +50 -0
- package/utils/validators/formRules/index.ts +5 -5
- package/utils/validators/machine-pool.ts +1 -1
- package/utils/validators/setting.js +18 -3
- package/utils/xccdf.ts +415 -0
- package/vue.config.js +1 -1
- package/assets/fonts/lato/lato-v17-latin-700.woff +0 -0
- package/assets/fonts/lato/lato-v17-latin-700.woff2 +0 -0
- package/assets/fonts/lato/lato-v17-latin-regular.woff +0 -0
- package/assets/fonts/lato/lato-v17-latin-regular.woff2 +0 -0
- package/pages/support/index.vue +0 -264
- package/utils/duration.js +0 -43
|
@@ -96,7 +96,18 @@ export default {
|
|
|
96
96
|
await this.value.waitForProvisioner();
|
|
97
97
|
|
|
98
98
|
// Support for the 'provisioner' extension
|
|
99
|
-
|
|
99
|
+
let extClass = this.$extension.getDynamic('provisioner', this.value.machineProvider);
|
|
100
|
+
let provider = this.value.machineProvider;
|
|
101
|
+
|
|
102
|
+
if (!extClass) {
|
|
103
|
+
extClass = this.$extension.getDynamic('provisioner', this.value.provisioner.toLowerCase());
|
|
104
|
+
provider = this.value.provisioner.toLowerCase();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!extClass && this.value.isImported) {
|
|
108
|
+
extClass = this.$extension.getDynamic('provisioner', 'imported');
|
|
109
|
+
provider = 'imported';
|
|
110
|
+
}
|
|
100
111
|
|
|
101
112
|
if (extClass) {
|
|
102
113
|
this.extProvider = new extClass({
|
|
@@ -111,7 +122,7 @@ export default {
|
|
|
111
122
|
...this.extDetailTabs,
|
|
112
123
|
...this.extProvider.detailTabs
|
|
113
124
|
};
|
|
114
|
-
this.extCustomParams = { provider
|
|
125
|
+
this.extCustomParams = { provider };
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
// Support for a model extension
|
|
@@ -120,7 +131,7 @@ export default {
|
|
|
120
131
|
...this.extDetailTabs,
|
|
121
132
|
...this.value.customProvisionerHelper.detailTabs
|
|
122
133
|
};
|
|
123
|
-
this.extCustomParams = { provider
|
|
134
|
+
this.extCustomParams = { provider };
|
|
124
135
|
}
|
|
125
136
|
|
|
126
137
|
const schema = this.$store.getters[`management/schemaFor`](CAPI.RANCHER_CLUSTER);
|
|
@@ -147,10 +158,6 @@ export default {
|
|
|
147
158
|
fetchOne.normanClusters = this.$store.dispatch('rancher/findAll', { type: NORMAN.CLUSTER });
|
|
148
159
|
}
|
|
149
160
|
|
|
150
|
-
if ( this.value.isRke1 && this.$store.getters['isRancher'] ) {
|
|
151
|
-
fetchOne.normanNodePools = this.$store.dispatch('rancher/findAll', { type: NORMAN.NODE_POOL });
|
|
152
|
-
}
|
|
153
|
-
|
|
154
161
|
const fetchOneRes = await allHash(fetchOne);
|
|
155
162
|
|
|
156
163
|
this.allMachines = fetchOneRes.machines || [];
|
|
@@ -203,10 +210,6 @@ export default {
|
|
|
203
210
|
if ( this.$store.getters['management/canList'](MANAGEMENT.RKE_TEMPLATE) ) {
|
|
204
211
|
this.$store.dispatch('management/findAll', { type: MANAGEMENT.RKE_TEMPLATE });
|
|
205
212
|
}
|
|
206
|
-
|
|
207
|
-
if ( this.$store.getters['management/canList'](MANAGEMENT.RKE_TEMPLATE_REVISION) ) {
|
|
208
|
-
this.$store.dispatch('management/findAll', { type: MANAGEMENT.RKE_TEMPLATE_REVISION });
|
|
209
|
-
}
|
|
210
213
|
},
|
|
211
214
|
|
|
212
215
|
created() {
|
|
@@ -284,9 +287,11 @@ export default {
|
|
|
284
287
|
extCustomParams: null,
|
|
285
288
|
extDetailTabs: {
|
|
286
289
|
machines: true, // in this component
|
|
290
|
+
nodes: true, // in this component
|
|
287
291
|
logs: true, // in this component
|
|
288
292
|
registration: true, // in this component
|
|
289
293
|
snapshots: true, // in this component
|
|
294
|
+
autoscaler: true, // in this component
|
|
290
295
|
related: true, // in ResourceTabs
|
|
291
296
|
events: true, // in ResourceTabs
|
|
292
297
|
conditions: true, // in ResourceTabs
|
|
@@ -408,8 +413,23 @@ export default {
|
|
|
408
413
|
|
|
409
414
|
const templateNamePrefix = `${ pool.metadata.name }-`;
|
|
410
415
|
|
|
416
|
+
// The MachineDeployment still exists for empty pools. The
|
|
417
|
+
// infrastructureRef points to the template that matches the current
|
|
418
|
+
// config. Fallback to the prefix-match to return an arbitrary template
|
|
419
|
+
// when multiple exist
|
|
420
|
+
const machineDeployment = this.allMachineDeployments.find(
|
|
421
|
+
(d) => d.metadata.name === pool.metadata.name && d.metadata.namespace === pool.metadata.namespace
|
|
422
|
+
);
|
|
423
|
+
const activeTemplateName = machineDeployment?.spec?.template?.spec?.infrastructureRef?.name;
|
|
424
|
+
|
|
411
425
|
// All of these properties are needed to ensure the pool displays correctly and that we can scale up and down
|
|
412
|
-
pool._template = this.machineTemplates.find((t) =>
|
|
426
|
+
pool._template = this.machineTemplates.find((t) => {
|
|
427
|
+
if (activeTemplateName) {
|
|
428
|
+
return t.metadata.name === activeTemplateName;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return t.metadata.name.startsWith(templateNamePrefix);
|
|
432
|
+
});
|
|
413
433
|
pool._cluster = this.value;
|
|
414
434
|
pool._clusterSpec = mp;
|
|
415
435
|
|
|
@@ -451,7 +471,7 @@ export default {
|
|
|
451
471
|
},
|
|
452
472
|
|
|
453
473
|
showNodes() {
|
|
454
|
-
return !this.showMachines && this.haveNodes && !!this.nodes.length && this.extDetailTabs.
|
|
474
|
+
return !this.showMachines && this.haveNodes && !!this.nodes.length && this.extDetailTabs.nodes;
|
|
455
475
|
},
|
|
456
476
|
|
|
457
477
|
showSnapshots() {
|
|
@@ -628,7 +648,7 @@ export default {
|
|
|
628
648
|
},
|
|
629
649
|
|
|
630
650
|
showAutoScalerTab() {
|
|
631
|
-
return isAutoscalerFeatureFlagEnabled(this.$store) && this.value.hasAccessToAutoscalerConfigMap;
|
|
651
|
+
return isAutoscalerFeatureFlagEnabled(this.$store) && this.value.hasAccessToAutoscalerConfigMap && this.extDetailTabs.autoscaler;
|
|
632
652
|
}
|
|
633
653
|
},
|
|
634
654
|
|
|
@@ -36,7 +36,8 @@ export default {
|
|
|
36
36
|
nodes: fetchNodesForServiceTargets({
|
|
37
37
|
$store: this.$store,
|
|
38
38
|
inStore: this.$store.getters['currentStore']()
|
|
39
|
-
})
|
|
39
|
+
}),
|
|
40
|
+
summaries: this.value.fetchSummaries()
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
if (this.podSchema) {
|
|
@@ -71,7 +72,6 @@ export default {
|
|
|
71
72
|
this.showProjectMetrics = await allDashboardsExist(this.$store, this.currentCluster.id, [this.WORKLOAD_PROJECT_METRICS_DETAIL_URL, this.WORKLOAD_PROJECT_METRICS_SUMMARY_URL], 'cluster', projectId);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
this.findMatchingIngresses();
|
|
75
75
|
},
|
|
76
76
|
|
|
77
77
|
async unmounted() {
|
|
@@ -82,8 +82,6 @@ export default {
|
|
|
82
82
|
|
|
83
83
|
data() {
|
|
84
84
|
return {
|
|
85
|
-
allIngresses: [],
|
|
86
|
-
matchingIngresses: [],
|
|
87
85
|
WORKLOAD_METRICS_DETAIL_URL,
|
|
88
86
|
WORKLOAD_METRICS_SUMMARY_URL,
|
|
89
87
|
POD_PROJECT_METRICS_DETAIL_URL: '',
|
|
@@ -124,6 +122,10 @@ export default {
|
|
|
124
122
|
return this.$store.getters['cluster/schemaFor'](SERVICE);
|
|
125
123
|
},
|
|
126
124
|
|
|
125
|
+
relatedServices() {
|
|
126
|
+
return this.value.relatedServices;
|
|
127
|
+
},
|
|
128
|
+
|
|
127
129
|
podTemplateSpec() {
|
|
128
130
|
if ( this.value.type === WORKLOAD_TYPES.CRON_JOB ) {
|
|
129
131
|
return this.value.spec.jobTemplate.spec.template.spec;
|
|
@@ -208,51 +210,6 @@ export default {
|
|
|
208
210
|
}
|
|
209
211
|
},
|
|
210
212
|
|
|
211
|
-
methods: {
|
|
212
|
-
findMatchingIngresses() {
|
|
213
|
-
if (!this.ingressSchema) {
|
|
214
|
-
return [];
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Find Ingresses that forward traffic to Services
|
|
218
|
-
// that select this workload.
|
|
219
|
-
const matchingIngresses = this.allIngresses.filter((ingress) => {
|
|
220
|
-
try {
|
|
221
|
-
const rules = ingress.spec.rules;
|
|
222
|
-
|
|
223
|
-
if (!rules || !Array.isArray(rules)) return false;
|
|
224
|
-
|
|
225
|
-
for (let i = 0; i < rules.length; i++) {
|
|
226
|
-
const paths = rules[i]?.http?.paths;
|
|
227
|
-
|
|
228
|
-
if (!paths || !Array.isArray(paths)) continue;
|
|
229
|
-
// For each Ingress, check if any Services that match
|
|
230
|
-
// this workload are also target backends for the Ingress.
|
|
231
|
-
for (let j = 0; j < paths.length; j++) {
|
|
232
|
-
const pathData = paths[j];
|
|
233
|
-
const targetServiceName = pathData?.backend?.service?.name;
|
|
234
|
-
|
|
235
|
-
if (!targetServiceName) continue;
|
|
236
|
-
|
|
237
|
-
for (let k = 0; k < this.value.relatedServices.length; k++) {
|
|
238
|
-
const service = this.value.relatedServices[k];
|
|
239
|
-
const matchingServiceName = service?.metadata?.name;
|
|
240
|
-
|
|
241
|
-
if (ingress.metadata?.namespace === this.value.metadata?.namespace && matchingServiceName === targetServiceName) {
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
} catch (err) {
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
this.matchingIngresses = matchingIngresses;
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
|
|
256
213
|
watch: {
|
|
257
214
|
async 'value.jobRelationships.length'(neu, old) {
|
|
258
215
|
// If there are MORE jobs ensure we go out and fetch them (changes and removals are tracked by watches)
|
|
@@ -348,7 +305,7 @@ export default {
|
|
|
348
305
|
{{ t('workload.detail.cannotViewServices') }}
|
|
349
306
|
</p>
|
|
350
307
|
<p
|
|
351
|
-
v-else-if="
|
|
308
|
+
v-else-if="relatedServices.length === 0"
|
|
352
309
|
class="caption"
|
|
353
310
|
>
|
|
354
311
|
{{ t('workload.detail.cannotFindServices') }}
|
|
@@ -360,8 +317,8 @@ export default {
|
|
|
360
317
|
{{ t('workload.detail.serviceListCaption') }}
|
|
361
318
|
</p>
|
|
362
319
|
<ResourceTable
|
|
363
|
-
v-if="serviceSchema &&
|
|
364
|
-
:rows="
|
|
320
|
+
v-if="serviceSchema && relatedServices.length > 0"
|
|
321
|
+
:rows="relatedServices"
|
|
365
322
|
:headers="serviceHeaders"
|
|
366
323
|
key-field="id"
|
|
367
324
|
:schema="serviceSchema"
|
|
@@ -390,7 +347,7 @@ export default {
|
|
|
390
347
|
{{ t('workload.detail.cannotViewIngresses') }}
|
|
391
348
|
</p>
|
|
392
349
|
<p
|
|
393
|
-
v-else-if="matchingIngresses.length === 0"
|
|
350
|
+
v-else-if="value.matchingIngresses.length === 0"
|
|
394
351
|
class="caption"
|
|
395
352
|
>
|
|
396
353
|
{{ t('workload.detail.cannotFindIngresses') }}
|
|
@@ -402,8 +359,8 @@ export default {
|
|
|
402
359
|
{{ t('workload.detail.ingressListCaption') }}
|
|
403
360
|
</p>
|
|
404
361
|
<ResourceTable
|
|
405
|
-
v-if="ingressSchema && matchingIngresses.length > 0"
|
|
406
|
-
:rows="matchingIngresses"
|
|
362
|
+
v-if="ingressSchema && value.matchingIngresses.length > 0"
|
|
363
|
+
:rows="value.matchingIngresses"
|
|
407
364
|
:headers="ingressHeaders"
|
|
408
365
|
key-field="id"
|
|
409
366
|
:schema="ingressSchema"
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { shallowMount, VueWrapper } from '@vue/test-utils';
|
|
2
|
+
import CruCatalogRepo from '@shell/edit/catalog.cattle.io.clusterrepo.vue';
|
|
3
|
+
import { _CREATE, _EDIT } from '@shell/config/query-params';
|
|
4
|
+
|
|
5
|
+
const createEditViewMock = {
|
|
6
|
+
props: {
|
|
7
|
+
value: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: () => ({}),
|
|
10
|
+
},
|
|
11
|
+
realMode: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: _CREATE,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return { errors: [] };
|
|
18
|
+
},
|
|
19
|
+
computed: {
|
|
20
|
+
isCreate: () => false,
|
|
21
|
+
isEdit: () => true,
|
|
22
|
+
isView: () => false,
|
|
23
|
+
schema: () => ({}),
|
|
24
|
+
isNamespaced: () => false,
|
|
25
|
+
labels: {
|
|
26
|
+
get: jest.fn(() => ({})),
|
|
27
|
+
set: jest.fn(),
|
|
28
|
+
},
|
|
29
|
+
annotations: {
|
|
30
|
+
get: jest.fn(() => ({})),
|
|
31
|
+
set: jest.fn(),
|
|
32
|
+
},
|
|
33
|
+
doneRoute: () => 'mockedRoute',
|
|
34
|
+
doneParams: () => ({}),
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
done: jest.fn(),
|
|
38
|
+
conflict: jest.fn(() => Promise.resolve([])),
|
|
39
|
+
save: jest.fn(() => Promise.resolve()),
|
|
40
|
+
actuallySave: jest.fn(() => Promise.resolve()),
|
|
41
|
+
setErrors: jest.fn(),
|
|
42
|
+
registerBeforeHook: jest.fn(),
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
jest.mock('@shell/config/version', () => ({ getVersionData: () => ({ RancherPrime: 'false' }) }));
|
|
47
|
+
jest.mock('@shell/utils/require-asset', () => ({ requireAsset: (path: string) => path }));
|
|
48
|
+
|
|
49
|
+
const defaultGlobalMocks = {
|
|
50
|
+
$store: {
|
|
51
|
+
getters: {
|
|
52
|
+
'i18n/t': (key: string) => key,
|
|
53
|
+
currentProduct: { inStore: 'cluster' },
|
|
54
|
+
'cluster/byId': () => null,
|
|
55
|
+
'cluster/all': () => [],
|
|
56
|
+
},
|
|
57
|
+
dispatch: jest.fn(),
|
|
58
|
+
},
|
|
59
|
+
$route: {
|
|
60
|
+
name: 'test-route',
|
|
61
|
+
query: {},
|
|
62
|
+
},
|
|
63
|
+
$fetchState: { pending: false },
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const createWrapper = (specOverrides = {}, mode = _EDIT): VueWrapper<any> => {
|
|
67
|
+
return shallowMount(CruCatalogRepo, {
|
|
68
|
+
props: {
|
|
69
|
+
value: {
|
|
70
|
+
spec: { url: 'https://test.com', ...specOverrides },
|
|
71
|
+
isOciType: false,
|
|
72
|
+
isSuseAppCollectionFromUI: false,
|
|
73
|
+
metadata: { name: 'test-repo', annotations: {} },
|
|
74
|
+
},
|
|
75
|
+
realMode: mode,
|
|
76
|
+
},
|
|
77
|
+
mixins: [createEditViewMock],
|
|
78
|
+
global: {
|
|
79
|
+
mocks: defaultGlobalMocks,
|
|
80
|
+
stubs: {
|
|
81
|
+
AsyncButton: true,
|
|
82
|
+
Footer: true,
|
|
83
|
+
NameNsDescription: true,
|
|
84
|
+
Labels: true,
|
|
85
|
+
SelectOrCreateAuthSecret: true,
|
|
86
|
+
Banner: true,
|
|
87
|
+
RcItemCard: true,
|
|
88
|
+
UnitInput: true,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
describe('CruCatalogRepo - refresh interval', () => {
|
|
95
|
+
describe('initial state', () => {
|
|
96
|
+
it('defaults to enabled with null display value when no refreshInterval is set', () => {
|
|
97
|
+
const wrapper = createWrapper();
|
|
98
|
+
|
|
99
|
+
expect(wrapper.vm.refreshEnabled).toStrictEqual(true);
|
|
100
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(null);
|
|
101
|
+
expect(wrapper.vm.refreshUnit).toStrictEqual(3600);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('parses existing refreshInterval into display value and unit', () => {
|
|
105
|
+
const wrapper = createWrapper({ refreshInterval: 7200 });
|
|
106
|
+
|
|
107
|
+
expect(wrapper.vm.refreshEnabled).toStrictEqual(true);
|
|
108
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(2);
|
|
109
|
+
expect(wrapper.vm.refreshUnit).toStrictEqual(3600);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('parses refreshInterval that maps to minutes', () => {
|
|
113
|
+
const wrapper = createWrapper({ refreshInterval: 300 });
|
|
114
|
+
|
|
115
|
+
expect(wrapper.vm.refreshEnabled).toStrictEqual(true);
|
|
116
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(5);
|
|
117
|
+
expect(wrapper.vm.refreshUnit).toStrictEqual(60);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('parses refreshInterval that maps to days', () => {
|
|
121
|
+
const wrapper = createWrapper({ refreshInterval: 172800 });
|
|
122
|
+
|
|
123
|
+
expect(wrapper.vm.refreshEnabled).toStrictEqual(true);
|
|
124
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(2);
|
|
125
|
+
expect(wrapper.vm.refreshUnit).toStrictEqual(86400);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('parses refreshInterval that maps to seconds', () => {
|
|
129
|
+
const wrapper = createWrapper({ refreshInterval: 45 });
|
|
130
|
+
|
|
131
|
+
expect(wrapper.vm.refreshEnabled).toStrictEqual(true);
|
|
132
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(45);
|
|
133
|
+
expect(wrapper.vm.refreshUnit).toStrictEqual(1);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('sets refreshEnabled to false when refreshInterval is -1', () => {
|
|
137
|
+
const wrapper = createWrapper({ refreshInterval: -1 });
|
|
138
|
+
|
|
139
|
+
expect(wrapper.vm.refreshEnabled).toStrictEqual(false);
|
|
140
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(null);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
describe('syncRefreshIntervalToSpec', () => {
|
|
145
|
+
it('sets spec.refreshInterval to -1 when disabled', () => {
|
|
146
|
+
const wrapper = createWrapper();
|
|
147
|
+
|
|
148
|
+
wrapper.vm.onRefreshEnabledChange(false);
|
|
149
|
+
|
|
150
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(-1);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('deletes spec.refreshInterval when input is empty', () => {
|
|
154
|
+
const wrapper = createWrapper({ refreshInterval: 3600 });
|
|
155
|
+
|
|
156
|
+
wrapper.vm.onRefreshValueChange('');
|
|
157
|
+
|
|
158
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(undefined);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('deletes spec.refreshInterval when input is 0', () => {
|
|
162
|
+
const wrapper = createWrapper({ refreshInterval: 3600 });
|
|
163
|
+
|
|
164
|
+
wrapper.vm.onRefreshValueChange('0');
|
|
165
|
+
|
|
166
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(undefined);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('converts display value and unit to seconds on spec', () => {
|
|
170
|
+
const wrapper = createWrapper();
|
|
171
|
+
|
|
172
|
+
wrapper.vm.onRefreshValueChange('5');
|
|
173
|
+
|
|
174
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(5 * 3600);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('recalculates when unit changes', () => {
|
|
178
|
+
const wrapper = createWrapper();
|
|
179
|
+
|
|
180
|
+
wrapper.vm.onRefreshValueChange('2');
|
|
181
|
+
wrapper.vm.onRefreshUnitChange(60);
|
|
182
|
+
|
|
183
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(120);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('recalculates when re-enabled', () => {
|
|
187
|
+
const wrapper = createWrapper();
|
|
188
|
+
|
|
189
|
+
wrapper.vm.onRefreshValueChange('10');
|
|
190
|
+
wrapper.vm.onRefreshEnabledChange(false);
|
|
191
|
+
|
|
192
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(-1);
|
|
193
|
+
|
|
194
|
+
wrapper.vm.onRefreshEnabledChange(true);
|
|
195
|
+
|
|
196
|
+
expect(wrapper.vm.value.spec.refreshInterval).toStrictEqual(10 * 3600);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
describe('onRefreshValueChange', () => {
|
|
201
|
+
it('normalizes empty string to null', () => {
|
|
202
|
+
const wrapper = createWrapper();
|
|
203
|
+
|
|
204
|
+
wrapper.vm.onRefreshValueChange('');
|
|
205
|
+
|
|
206
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(null);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('normalizes null to null', () => {
|
|
210
|
+
const wrapper = createWrapper();
|
|
211
|
+
|
|
212
|
+
wrapper.vm.onRefreshValueChange(null);
|
|
213
|
+
|
|
214
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(null);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it('coerces string value to number', () => {
|
|
218
|
+
const wrapper = createWrapper();
|
|
219
|
+
|
|
220
|
+
wrapper.vm.onRefreshValueChange('42');
|
|
221
|
+
|
|
222
|
+
expect(wrapper.vm.refreshDisplayValue).toStrictEqual(42);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe('validation', () => {
|
|
227
|
+
it('returns error for negative values', () => {
|
|
228
|
+
const wrapper = createWrapper();
|
|
229
|
+
const rule = wrapper.vm.refreshIntervalRules[0];
|
|
230
|
+
|
|
231
|
+
expect(rule(-1)).toBeDefined();
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('returns undefined for zero', () => {
|
|
235
|
+
const wrapper = createWrapper();
|
|
236
|
+
const rule = wrapper.vm.refreshIntervalRules[0];
|
|
237
|
+
|
|
238
|
+
expect(rule(0)).toStrictEqual(undefined);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('returns undefined for positive values', () => {
|
|
242
|
+
const wrapper = createWrapper();
|
|
243
|
+
const rule = wrapper.vm.refreshIntervalRules[0];
|
|
244
|
+
|
|
245
|
+
expect(rule(5)).toStrictEqual(undefined);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
});
|
|
@@ -28,12 +28,17 @@ const mocks = {
|
|
|
28
28
|
$fetchState: { pending: false },
|
|
29
29
|
$route: {
|
|
30
30
|
query: { AS: '' },
|
|
31
|
+
hash: '',
|
|
31
32
|
name: {
|
|
32
33
|
endsWith: () => {
|
|
33
34
|
return false;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
},
|
|
38
|
+
$router: {
|
|
39
|
+
currentRoute: { _value: { hash: '' } },
|
|
40
|
+
replace: jest.fn(),
|
|
41
|
+
},
|
|
37
42
|
};
|
|
38
43
|
|
|
39
44
|
const mockComputed = {
|
|
@@ -152,6 +157,106 @@ describe('helmOp component lifecycle', () => {
|
|
|
152
157
|
});
|
|
153
158
|
});
|
|
154
159
|
|
|
160
|
+
describe('onCancel', () => {
|
|
161
|
+
it('should navigate back to the AppCo chart page with version when isSuseAppCollection is true and mode is CREATE', () => {
|
|
162
|
+
const routerPush = jest.fn();
|
|
163
|
+
const appCoMocks = {
|
|
164
|
+
...mocks,
|
|
165
|
+
$route: {
|
|
166
|
+
...mocks.$route,
|
|
167
|
+
query: {
|
|
168
|
+
AS: '',
|
|
169
|
+
type: 'suse-application-collection',
|
|
170
|
+
chart: 'alertmanager',
|
|
171
|
+
version: '1.37.0',
|
|
172
|
+
secret: 'fleet-appco-auth-2n9px',
|
|
173
|
+
},
|
|
174
|
+
params: { cluster: 'local' },
|
|
175
|
+
},
|
|
176
|
+
$router: {
|
|
177
|
+
...mocks.$router,
|
|
178
|
+
push: routerPush,
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const wrapper = mount(HelmOpComponent, {
|
|
183
|
+
...initHelmOp({ mode: _CREATE, realMode: _CREATE }),
|
|
184
|
+
computed: {
|
|
185
|
+
...mockComputed,
|
|
186
|
+
isSuseAppCollection: () => true,
|
|
187
|
+
},
|
|
188
|
+
global: { mocks: appCoMocks },
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
wrapper.vm.onCancel();
|
|
192
|
+
|
|
193
|
+
expect(routerPush).toHaveBeenCalledWith({
|
|
194
|
+
name: 'c-cluster-fleet-application-appco-chart',
|
|
195
|
+
params: { cluster: 'local' },
|
|
196
|
+
query: {
|
|
197
|
+
'repo-type': 'cluster',
|
|
198
|
+
repo: 'fleet-appco-repo-2n9px',
|
|
199
|
+
chart: 'alertmanager',
|
|
200
|
+
version: '1.37.0',
|
|
201
|
+
secret: 'fleet-appco-auth-2n9px',
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('should navigate back to the AppCo chart page without version when version is not in query', () => {
|
|
207
|
+
const routerPush = jest.fn();
|
|
208
|
+
const appCoMocks = {
|
|
209
|
+
...mocks,
|
|
210
|
+
$route: {
|
|
211
|
+
...mocks.$route,
|
|
212
|
+
query: {
|
|
213
|
+
AS: '',
|
|
214
|
+
type: 'suse-application-collection',
|
|
215
|
+
chart: 'alertmanager',
|
|
216
|
+
secret: 'fleet-appco-auth-2n9px',
|
|
217
|
+
},
|
|
218
|
+
params: { cluster: 'local' },
|
|
219
|
+
},
|
|
220
|
+
$router: {
|
|
221
|
+
...mocks.$router,
|
|
222
|
+
push: routerPush,
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const wrapper = mount(HelmOpComponent, {
|
|
227
|
+
...initHelmOp({ mode: _CREATE, realMode: _CREATE }),
|
|
228
|
+
computed: {
|
|
229
|
+
...mockComputed,
|
|
230
|
+
isSuseAppCollection: () => true,
|
|
231
|
+
},
|
|
232
|
+
global: { mocks: appCoMocks },
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
wrapper.vm.onCancel();
|
|
236
|
+
|
|
237
|
+
expect(routerPush).toHaveBeenCalledWith({
|
|
238
|
+
name: 'c-cluster-fleet-application-appco-chart',
|
|
239
|
+
params: { cluster: 'local' },
|
|
240
|
+
query: {
|
|
241
|
+
'repo-type': 'cluster',
|
|
242
|
+
repo: 'fleet-appco-repo-2n9px',
|
|
243
|
+
chart: 'alertmanager',
|
|
244
|
+
version: undefined,
|
|
245
|
+
secret: 'fleet-appco-auth-2n9px',
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('should call done() when not a SuseAppCollection', () => {
|
|
251
|
+
const wrapper = mount(HelmOpComponent, initHelmOp({ mode: _CREATE, realMode: _CREATE }));
|
|
252
|
+
|
|
253
|
+
jest.spyOn(wrapper.vm, 'done').mockImplementation(jest.fn());
|
|
254
|
+
wrapper.vm.onCancel();
|
|
255
|
+
|
|
256
|
+
expect(wrapper.vm.done).toHaveBeenCalledWith();
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
|
|
155
260
|
describe.each([
|
|
156
261
|
_CREATE,
|
|
157
262
|
_EDIT,
|
|
@@ -21,6 +21,7 @@ exports[`component: General rendering & initial state should render with default
|
|
|
21
21
|
labelkey="auditPolicy.general.enabled.checkbox"
|
|
22
22
|
mode="create"
|
|
23
23
|
primary="false"
|
|
24
|
+
usebodytextcolor="false"
|
|
24
25
|
value="false"
|
|
25
26
|
valuewhentrue="true"
|
|
26
27
|
/>
|
|
@@ -71,6 +72,7 @@ exports[`component: General rendering & initial state should render with default
|
|
|
71
72
|
label="auditPolicy.general.verbosity.level.label"
|
|
72
73
|
loading="false"
|
|
73
74
|
localizedlabel="false"
|
|
75
|
+
lockedoptions=""
|
|
74
76
|
mode="create"
|
|
75
77
|
nooptionslabelkey="labelSelect.noOptions.empty"
|
|
76
78
|
optionlabel="label"
|
|
@@ -112,6 +114,7 @@ exports[`component: General rendering & initial state should render with default
|
|
|
112
114
|
label="auditPolicy.general.verbosity.request.requestHeaders"
|
|
113
115
|
mode="create"
|
|
114
116
|
primary="false"
|
|
117
|
+
usebodytextcolor="false"
|
|
115
118
|
value="false"
|
|
116
119
|
valuewhentrue="true"
|
|
117
120
|
/>
|
|
@@ -127,6 +130,7 @@ exports[`component: General rendering & initial state should render with default
|
|
|
127
130
|
label="auditPolicy.general.verbosity.request.requestBody"
|
|
128
131
|
mode="create"
|
|
129
132
|
primary="false"
|
|
133
|
+
usebodytextcolor="false"
|
|
130
134
|
value="false"
|
|
131
135
|
valuewhentrue="true"
|
|
132
136
|
/>
|
|
@@ -152,6 +156,7 @@ exports[`component: General rendering & initial state should render with default
|
|
|
152
156
|
label="auditPolicy.general.verbosity.response.responseHeaders"
|
|
153
157
|
mode="create"
|
|
154
158
|
primary="false"
|
|
159
|
+
usebodytextcolor="false"
|
|
155
160
|
value="false"
|
|
156
161
|
valuewhentrue="true"
|
|
157
162
|
/>
|
|
@@ -167,6 +172,7 @@ exports[`component: General rendering & initial state should render with default
|
|
|
167
172
|
label="auditPolicy.general.verbosity.response.responseBody"
|
|
168
173
|
mode="create"
|
|
169
174
|
primary="false"
|
|
175
|
+
usebodytextcolor="false"
|
|
170
176
|
value="false"
|
|
171
177
|
valuewhentrue="true"
|
|
172
178
|
/>
|