Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pagination-home-page
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Jan 3, 2025
2 parents 3d1b497 + 9266a51 commit 4919e07
Show file tree
Hide file tree
Showing 33 changed files with 249 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
['@manager'],
['@userMenu', '@usersAndAuths'],
['@components'],
# ['@vai'] // https://github.com/rancher/dashboard/issues/12856
['@vai']
]
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export default class ClusterManagerCreatePagePo extends ClusterManagerCreateImpo
return this.self().contains('.grid .name', name, { timeout: 10000 }).should(assertion);
}

gridElementGroupTitles() {
return this.self().find('.subtypes-container > div > h4');
}

selectKubeProvider(index: number) {
return this.resourceDetail().cruResource().selectSubType(0, index).click();
}
Expand Down
8 changes: 7 additions & 1 deletion cypress/e2e/tests/pages/explorer/apps/repositories.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ describe('Apps', () => {

// Ensure this runs after an attempt, rather than all attemps (`after` only runs once after all cypress retries)
afterEach(() => {
reposToDelete.forEach((r) => cy.deleteRancherResource('v1', 'catalog.cattle.io.clusterrepos', r));
for (const repo of reposToDelete) {
cy.deleteRancherResource('v1', 'catalog.cattle.io.clusterrepos', repo, false).then((res: Cypress.Response<any>) => {
if (res.status === 201) {
reposToDelete.splice(reposToDelete.indexOf(repo), 1);
}
});
}
});
});

Expand Down
64 changes: 64 additions & 0 deletions cypress/e2e/tests/pages/manager/cluster-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po';
import TabbedPo from '@/cypress/e2e/po/components/tabbed.po';
import LoadingPo from '@/cypress/e2e/po/components/loading.po';
import { EXTRA_LONG_TIMEOUT_OPT, MEDIUM_TIMEOUT_OPT } from '@/cypress/support/utils/timeouts';
import KontainerDriversPagePo from '@/cypress/e2e/po/pages/cluster-manager/kontainer-drivers.po';
import DeactivateDriverDialogPo from '@/cypress/e2e/po/prompts/deactivateDriverDialog.po';

// At some point these will come from somewhere central, then we can make tools to remove resources from this or all runs
const runTimestamp = +new Date();
Expand Down Expand Up @@ -88,6 +90,68 @@ describe('Cluster Manager', { testIsolation: 'off', tags: ['@manager', '@adminUs
});
});

it('deactivating a kontainer driver should hide its card from the cluster creation page', () => {
const driversPage = new KontainerDriversPagePo();
const clusterCreatePage = new ClusterManagerCreatePagePo();

// deactivate the AKS driver
KontainerDriversPagePo.navTo();
driversPage.waitForPage();
driversPage.list().actionMenu('Azure AKS').getMenuItem('Deactivate').click();
const deactivateDialog = new DeactivateDriverDialogPo();

deactivateDialog.deactivate();

// verify that the AKS card is not shown
clusterList.goTo();
clusterList.checkIsCurrentPage();
clusterList.createCluster();
clusterCreatePage.gridElementExistanceByName('Azure AKS', 'not.exist');

// re-enable the AKS kontainer driver
KontainerDriversPagePo.navTo();
driversPage.waitForPage();
driversPage.list().actionMenu('Azure AKS').getMenuItem('Activate').click();

// verify that the AKS card is back
clusterList.goTo();
clusterList.checkIsCurrentPage();
clusterList.createCluster();
clusterCreatePage.gridElementExistanceByName('Azure AKS', 'exist');
});

it('deleting a kontainer driver should hide its card from the cluster creation page', () => {
// intercept get request for kontainer drivers
cy.intercept('GET', '/v1/management.cattle.io.kontainerdriver*', (req) => {
req.reply( {
type: 'collection',
resourceType: 'management.cattle.io.kontainerdriver',
count: 0,
data: []
});
} ).as('kontainerDrivers');

const clusterCreatePage = new ClusterManagerCreatePagePo();

// verify that the AKS card is not shown
clusterList.goTo();
clusterList.checkIsCurrentPage();
clusterList.createCluster();

clusterCreatePage.waitForPage();
cy.wait('@kontainerDrivers');

clusterCreatePage.rkeToggleExistance('exist');
clusterCreatePage.gridElementExistanceByName('Azure AKS', 'not.exist');

clusterCreatePage.gridElementGroupTitles().should('have.length', 2);

clusterCreatePage.gridElementGroupTitles().eq(0).should('not.contain.text', 'Create a cluster');

clusterCreatePage.gridElementGroupTitles().eq(0).should('contain.text', 'Provision new nodes');
clusterCreatePage.gridElementGroupTitles().eq(1).should('contain.text', 'Use existing nodes');
});

describe('All providers', () => {
providersList.forEach((prov) => {
prov.conditions.forEach((condition) => {
Expand Down
1 change: 1 addition & 0 deletions docusaurus/docs/extensions/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

| Date | Version | Description |
|---|---|---|
| TBD | [**3.1.0**](https://github.com/rancher/dashboard/releases) | [BREAKING] Bump TypeScript from 4.5.5 to 5.6.3: Extension developers need to bump TypeScript to version 5.6.3 in their projects. |
| 01&#160;November&#160;2024 | [**2.0.2**](https://github.com/rancher/dashboard/releases/tag/shell-pkg-v2.0.2) | Remove upper limit on kube version for default annotations on extensions. Update creators package. Minor bug fixes |
| 09&#160;July&#160;2024 | 1.2.3 | Minor bug fixes |
| 09&#160;July&#160;2024 | [**2.0.1**](https://github.com/rancher/dashboard/releases/tag/shell-pkg-v2.0.1) | Minor bug fixes |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"start-server-and-test": "1.13.1",
"style-loader": "3.3.2",
"ts-jest": "27.1.4",
"typescript": "4.5.5",
"typescript": "5.6.3",
"vue": "3.2.47",
"webpack-bundle-analyzer": "4.5.0",
"webpack-virtual-modules": "0.4.3",
Expand Down
7 changes: 7 additions & 0 deletions pkg/aks/provisioner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IClusterProvisioner, ClusterProvisionerContext } from '@shell/core/type
import CruAks from './components/CruAks.vue';
import { mapDriver } from '@shell/store/plugins';
import type { Component } from 'vue';
import { MANAGEMENT } from '@shell/config/types';

export class AKSProvisioner implements IClusterProvisioner {
static ID = 'azureaks'
Expand Down Expand Up @@ -30,6 +31,12 @@ export class AKSProvisioner implements IClusterProvisioner {
return CruAks;
}

get hidden(): boolean {
const kontainerDriver = this.context.getters['management/byId'](MANAGEMENT.KONTAINER_DRIVER, 'azurekubernetesservice');

return !kontainerDriver?.spec?.active;
}

get detailTabs(): any {
return {
machines: false,
Expand Down
10 changes: 7 additions & 3 deletions pkg/aks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
],
"@pkg/*": [
"../../pkg/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
9 changes: 8 additions & 1 deletion pkg/eks/provisioner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { IClusterProvisioner, ClusterProvisionerContext } from '@shell/core/types';
import CruEKS from './components/CruEKS.vue';
import { mapDriver } from '@shell/store/plugins';
import { Component } from 'vue/types/umd';
import { Component } from 'vue';
import { MANAGEMENT } from '@shell/config/types';

export class EKSProvisioner implements IClusterProvisioner {
static ID = 'amazoneks'
Expand Down Expand Up @@ -30,6 +31,12 @@ export class EKSProvisioner implements IClusterProvisioner {
return CruEKS;
}

get hidden(): boolean {
const kontainerDriver = this.context.getters['management/byId'](MANAGEMENT.KONTAINER_DRIVER, 'amazonelasticcontainerservice');

return !kontainerDriver?.spec?.active;
}

get detailTabs(): any {
return {
machines: false,
Expand Down
7 changes: 4 additions & 3 deletions pkg/eks/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
9 changes: 8 additions & 1 deletion pkg/gke/provisioner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { IClusterProvisioner, ClusterProvisionerContext } from '@shell/core/types';
import CruGKE from './components/CruGKE.vue';
import { mapDriver } from '@shell/store/plugins';
import { Component } from 'vue/types/umd';
import { Component } from 'vue';
import { MANAGEMENT } from '@shell/config/types';

export class GKEProvisioner implements IClusterProvisioner {
static ID = 'googlegke'
Expand Down Expand Up @@ -30,6 +31,12 @@ export class GKEProvisioner implements IClusterProvisioner {
return CruGKE;
}

get hidden(): boolean {
const kontainerDriver = this.context.getters['management/byId'](MANAGEMENT.KONTAINER_DRIVER, 'googlekubernetesengine');

return !kontainerDriver?.spec?.active;
}

get detailTabs(): any {
return {
machines: false,
Expand Down
7 changes: 4 additions & 3 deletions pkg/gke/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
5 changes: 3 additions & 2 deletions pkg/harvester-manager/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
"**/*.ts",
"**/*.tsx",
"**/*.vue",
"../../shell/core/types.ts"
"../../shell/core/types.ts",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"node_modules"
]
}
}
7 changes: 4 additions & 3 deletions pkg/kubectl-explain/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@
"../../shell/*"
],
"@components/*": [
"@rancher/components/*"
"../../pkg/rancher-components/src/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
"**/*.vue",
"../../shell/types/vue-shim.d.ts"
],
"exclude": [
"../../node_modules"
]
}
}
2 changes: 1 addition & 1 deletion pkg/rancher-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"jsonpath-plus": "10.0.7",
"sass": "1.55.0",
"sass-loader": "~12.0.0",
"typescript": "4.5.5",
"typescript": "5.6.3",
"vue": "~3.2.13",
"eslint-plugin-local-rules": "link:../../eslint-plugin-local-rules"
},
Expand Down
10 changes: 9 additions & 1 deletion shell/assets/styles/base/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@
}
}

// -------------------------------------------------------------------------------------------------
// Focus styles

@mixin form-focus {
// Focus for form like elements (not to be confused with basic :focus style)
outline: none;
border-color: var(--outline);
}
}

@mixin focus-outline {
// Focus for form like elements (not to be confused with basic :focus style)
outline: 2px solid var(--primary-keyboard-focus);
}
2 changes: 2 additions & 0 deletions shell/assets/styles/themes/_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $disabled : $medium;
$primary : #3D98D3;
$secondary : $darker;
$link : #3D98D3;
$keyboard-focus : #3300ff;

// Status colors
$success : #5D995D;
Expand Down Expand Up @@ -53,6 +54,7 @@ BODY, .theme-light {
--primary-border : #{$primary};
--primary-banner-bg : #{rgba($primary, 0.15)};
--primary-light-bg : #{rgba($primary, 0.05)};
--primary-keyboard-focus : #{$keyboard-focus};


.text-primary {
Expand Down
3 changes: 2 additions & 1 deletion shell/assets/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ locale:
none: (None)

nav:
expandCollapseAppBar: Expand/Collapse the Application Bar
harvesterDashboard: Harvester Dashboard
backToRancher: Cluster Manager
tools: Tools
Expand Down Expand Up @@ -1924,7 +1925,7 @@ cluster:
header: Registry for Rancher System Container Images
label: Enable cluster scoped container registry for Rancher system container images
description: "If enabled, Rancher will pull container images from this registry during cluster provisioning. By default, Rancher will also use this registry when installing Rancher's official Helm chart apps. If the cluster scoped registry is disabled, system images are pulled from the System Default Registry in the global settings."
docsLinkRke2: "For help configuring private registry mirrors, see the RKE2 <a href=\"https://docs.rke2.io/install/containerd_registry_configuration\" target=\"_blank\">documentation.</a>"
docsLinkRke2: "For help configuring private registry mirrors, see the RKE2 <a href=\"https://docs.rke2.io/install/private_registry\" target=\"_blank\">documentation.</a>"
docsLinkK3s: "For help configuring private registry mirrors, see the K3s <a href=\"https://docs.k3s.io/installation/private-registry\" target=\"_blank\">documentation.</a>"
provider:
aliyunecs: Aliyun ECS
Expand Down
2 changes: 1 addition & 1 deletion shell/assets/translations/zh-hans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ cluster:
privateRegistry:
label: 为 Rancher 系统容器镜像启用集群级别的容器镜像仓库
description: "如果启用,Rancher 将在集群配置期间从该镜像仓库中拉取容器镜像。默认情况下,Rancher 在安装 Rancher 的官方 Helm Chart 应用程序时也会使用此镜像仓库。如果集群级别的镜像仓库被禁用,将从全局设置中的系统默认镜像仓库中拉取系统镜像。"
docsLinkRke2: "如需配置私有镜像仓库 mirror 的帮助,请参阅 RKE2 <a href=\"https://docs.rke2.io/install/containerd_registry_configuration\" target=\"_blank\">文档</a>。"
docsLinkRke2: "如需配置私有镜像仓库 mirror 的帮助,请参阅 RKE2 <a href=\"https://docs.rke2.io/install/private_registry\" target=\"_blank\">文档</a>。"
docsLinkK3s: "如需配置私有镜像仓库 mirror 的帮助,请参阅 K3s <a href=\"https://docs.k3s.io/installation/private-registry\" target=\"_blank\">文档</a>。"
provider:
aliyunecs: Aliyun ECS
Expand Down
Loading

0 comments on commit 4919e07

Please sign in to comment.