Skip to content

Commit 384edcb

Browse files
authored
Fixes for carvel repo UI (#5248)
* Disable scope field when editing Signed-off-by: Antonio Gamez Diaz <[email protected]> * Move exported enums Signed-off-by: Antonio Gamez Diaz <[email protected]> * Disable inline in carvel Signed-off-by: Antonio Gamez Diaz <[email protected]> * Make getSupportedPackageRepositoryAuthTypes type-aware Signed-off-by: Antonio Gamez Diaz <[email protected]> * Rename css class Signed-off-by: Antonio Gamez Diaz <[email protected]> * Rename some conditions Signed-off-by: Antonio Gamez Diaz <[email protected]> * Fix typos Signed-off-by: Antonio Gamez Diaz <[email protected]> * Reword golang duration msg Signed-off-by: Antonio Gamez Diaz <[email protected]> * Disable rest of advanced params in carvel plugin Signed-off-by: Antonio Gamez Diaz <[email protected]> * Fix test Signed-off-by: Antonio Gamez Diaz <[email protected]> * Reset auth type if unsupported Signed-off-by: Antonio Gamez Diaz <[email protected]> * Fix test case Signed-off-by: Antonio Gamez Diaz <[email protected]> * Fix linter issue Signed-off-by: Antonio Gamez Diaz <[email protected]> Signed-off-by: Antonio Gamez Diaz <[email protected]>
1 parent 83b277a commit 384edcb

18 files changed

+376
-167
lines changed

cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/server_utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func buildPackageIdentifier(pkgMetadata *datapackagingv1alpha1.PackageMetadata)
146146
}
147147

148148
// getRepoNameFromAnnotation gets the repo name from a string with the format "namespace/repoName",
149-
// for instance "default/tce-repo", and retuns just the "repoName" part, e.g., "tce-repo"
149+
// for instance "default/tce-repo", and returns just the "repoName" part, e.g., "tce-repo"
150150
func getRepoNameFromAnnotation(repoRefAnnotation string) string {
151151
// falling back to a "default" repo name if using kapp controller < v0.36.1
152152
// See https://github.com/vmware-tanzu/carvel-kapp-controller/pull/532

cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/server_utils_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ func TestFilterMetadatas(t *testing.T) {
895895
},
896896
},
897897
{
898-
name: "does not match if metadata has an unkown repo",
898+
name: "does not match if metadata has an unknown repo",
899899
metadatas: []*datapackagingv1alpha1.PackageMetadata{
900900
{
901901
ObjectMeta: metav1.ObjectMeta{

dashboard/src/actions/installedpackages.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ import {
1515
import { Plugin } from "gen/kubeappsapis/core/plugins/v1alpha1/plugins";
1616
import { InstalledPackage } from "shared/InstalledPackage";
1717
import { getStore, initialState } from "shared/specs/mountWrapper";
18-
import { IStoreState, UnprocessableEntity, UpgradeError } from "shared/types";
19-
import { PluginNames } from "shared/utils";
18+
import { IStoreState, PluginNames, UnprocessableEntity, UpgradeError } from "shared/types";
2019
import { getType } from "typesafe-actions";
2120
import actions from ".";
2221

dashboard/src/actions/repos.test.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@ import thunk from "redux-thunk";
2424
import { PackageRepositoriesService } from "shared/PackageRepositoriesService";
2525
import PackagesService from "shared/PackagesService";
2626
import { initialState } from "shared/specs/mountWrapper";
27-
import { IPkgRepoFormData, IStoreState, NotFoundError, RepositoryStorageTypes } from "shared/types";
28-
import { PluginNames } from "shared/utils";
27+
import {
28+
IPkgRepoFormData,
29+
IStoreState,
30+
NotFoundError,
31+
PluginNames,
32+
RepositoryStorageTypes,
33+
} from "shared/types";
2934
import { getType } from "typesafe-actions";
3035
import actions from ".";
3136
import { convertPkgRepoDetailToSummary } from "./repos";

dashboard/src/components/AppUpgrade/AppUpgrade.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import {
3030
IInstalledPackageState,
3131
IPackageState,
3232
IStoreState,
33+
PluginNames,
3334
UpgradeError,
3435
} from "shared/types";
35-
import { PluginNames } from "shared/utils";
3636
import SelectRepoForm from "../SelectRepoForm/SelectRepoForm";
3737
import UpgradeForm from "../UpgradeForm/UpgradeForm";
3838
import AppUpgrade from "./AppUpgrade";

dashboard/src/components/AppView/AppView.test.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ import { IConfigState } from "reducers/config";
2828
import { InstalledPackage } from "shared/InstalledPackage";
2929
import PackagesService from "shared/PackagesService";
3030
import { getStore, mountWrapper } from "shared/specs/mountWrapper";
31-
import { DeleteError, FetchError, IInstalledPackageState, IStoreState } from "shared/types";
32-
import { PluginNames } from "shared/utils";
31+
import {
32+
DeleteError,
33+
FetchError,
34+
IInstalledPackageState,
35+
IStoreState,
36+
PluginNames,
37+
} from "shared/types";
3338
import { getType } from "typesafe-actions";
3439
import AccessURLTable from "./AccessURLTable/AccessURLTable";
3540
import DeleteButton from "./AppControls/DeleteButton/DeleteButton";

dashboard/src/components/Catalog/CatalogItems.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import InfoCard from "components/InfoCard";
55
import { AvailablePackageSummary, Context } from "gen/kubeappsapis/core/packages/v1alpha1/packages";
66
import { Plugin } from "gen/kubeappsapis/core/plugins/v1alpha1/plugins";
77
import { defaultStore, mountWrapper } from "shared/specs/mountWrapper";
8-
import { IClusterServiceVersion } from "shared/types";
9-
import { PluginNames } from "shared/utils";
8+
import { IClusterServiceVersion, PluginNames } from "shared/types";
109
import CatalogItem from "./CatalogItem";
1110
import CatalogItems, { ICatalogItemsProps } from "./CatalogItems";
1211

dashboard/src/components/Config/PkgRepoList/PkgRepoForm.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
font: caption;
88
}
99

10-
.ca-skip-tls {
11-
margin-top: -1em;
10+
.reduced-margin-top {
11+
margin-top: -0.5em;
1212
}
1313

1414
/* stylelint-disable-next-line selector-class-pattern */

dashboard/src/components/Config/PkgRepoList/PkgRepoForm.test.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ import { act } from "react-dom/test-utils";
1717
import * as ReactRedux from "react-redux";
1818
import { IPackageRepositoryState } from "reducers/repos";
1919
import { defaultStore, getStore, mountWrapper } from "shared/specs/mountWrapper";
20-
import { IPkgRepoFormData, IStoreState } from "shared/types";
21-
import { PluginNames } from "shared/utils";
22-
import { PkgRepoForm, RepositoryStorageTypes } from "./PkgRepoForm";
20+
import { IPkgRepoFormData, IStoreState, PluginNames, RepositoryStorageTypes } from "shared/types";
21+
import { PkgRepoForm } from "./PkgRepoForm";
2322

2423
const defaultProps = {
2524
onSubmit: jest.fn(),
@@ -161,6 +160,7 @@ it("shows an error creating a repo", async () => {
161160
<PkgRepoForm {...defaultProps} />,
162161
);
163162
});
163+
wrapper.update();
164164
expect(wrapper.find(Alert)).toIncludeText("boom!");
165165
});
166166

@@ -176,6 +176,7 @@ it("shows an error deleting a repo", async () => {
176176
<PkgRepoForm {...defaultProps} />,
177177
);
178178
});
179+
wrapper.update();
179180
expect(wrapper.find(Alert)).toIncludeText("boom!");
180181
});
181182

@@ -191,6 +192,7 @@ it("shows an error fetching a repo", async () => {
191192
<PkgRepoForm {...defaultProps} />,
192193
);
193194
});
195+
wrapper.update();
194196
expect(wrapper.find(Alert)).toIncludeText("boom!");
195197
});
196198

@@ -206,6 +208,7 @@ it("shows an error updating a repo", async () => {
206208
<PkgRepoForm {...defaultProps} />,
207209
);
208210
});
211+
wrapper.update();
209212
expect(wrapper.find(Alert)).toIncludeText("boom!");
210213
});
211214

@@ -525,6 +528,7 @@ it("should not show the list of OCI repositories if using a Helm repo (default)"
525528
wrapper.find("#kubeapps-repo-name").simulate("change", { target: { value: "helm-repo" } });
526529
wrapper.find("#kubeapps-repo-url").simulate("change", { target: { value: "helm.repo" } });
527530
wrapper.find("#kubeapps-repo-type-helm").simulate("change");
531+
wrapper.update();
528532
expect(wrapper.find("#kubeapps-oci-repositories")).not.toExist();
529533
});
530534

@@ -685,6 +689,7 @@ describe("when the repository info is already populated", () => {
685689
<PkgRepoForm {...defaultProps} packageRepoRef={packageRepoRef} />,
686690
);
687691
});
692+
wrapper.update();
688693
expect(wrapper.find("#kubeapps-repo-skip-tls")).toBeChecked();
689694
});
690695

@@ -703,6 +708,7 @@ describe("when the repository info is already populated", () => {
703708
<PkgRepoForm {...defaultProps} packageRepoRef={packageRepoRef} />,
704709
);
705710
});
711+
wrapper.update();
706712
expect(wrapper.find("#kubeapps-repo-pass-credentials")).toBeChecked();
707713
});
708714

0 commit comments

Comments
 (0)