Skip to content

Commit

Permalink
Bump prettier from 2.2.1 to 2.3.0 in /dashboard (#2825)
Browse files Browse the repository at this point in the history
* Bump prettier from 2.2.1 to 2.3.0 in /dashboard

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.2.1...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Add automatic formatting

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Antonio Gamez Diaz <agamez@vmware.com>
  • Loading branch information
dependabot[bot] and antgamdia committed May 19, 2021
1 parent cef2163 commit 4b0120f
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"mock-socket": "^9.0.3",
"moxios": "^0.4.0",
"npm-run-all": "^4.1.3",
"prettier": "^2.2.1",
"prettier": "^2.3.0",
"react-scripts": "^4.0.3",
"redux-mock-store": "^1.5.3",
"sass": "^1.32.12",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { IIngressSpec, IIngressTLS, IResource } from "shared/types";
import { IURLItem } from "./IURLItem";

const isURLRegex = /^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z-]{2,}|((\d{1,3}\.){3}\d{1,3}))(:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(#[-a-z\d_]*)?$/i;
const isURLRegex =
/^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z-]{2,}|((\d{1,3}\.){3}\d{1,3}))(:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(#[-a-z\d_]*)?$/i;

// URLs returns the list of URLs obtained from the service status
function URLs(ingress: IResource): string[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ it("deletes an application", async () => {
wrapper.update();
expect(wrapper.find(ConfirmDialog).prop("modalIsOpen")).toBe(true);
await act(async () => {
await (wrapper
.find(".btn")
.filterWhere(b => b.text() === "Delete")
.prop("onClick") as any)();
await (
wrapper
.find(".btn")
.filterWhere(b => b.text() === "Delete")
.prop("onClick") as any
)();
});
expect(deleteApp).toHaveBeenCalledWith(
defaultProps.cluster,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ it("rolls back an application", async () => {
.at(0)
.simulate("change", { target: { value: "1" } });
await act(async () => {
await (wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Rollback")
.prop("onClick") as any)();
await (
wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Rollback")
.prop("onClick") as any
)();
});
expect(rollbackApp).toHaveBeenCalledWith(
defaultProps.cluster,
Expand Down
17 changes: 5 additions & 12 deletions dashboard/src/components/AppView/AppView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ export default function AppView() {
return;
}

let parsedManifest: IResource[] = YAML.parseAllDocuments(
app.manifest,
).map((doc: YAML.Document) => doc.toJSON());
let parsedManifest: IResource[] = YAML.parseAllDocuments(app.manifest).map(
(doc: YAML.Document) => doc.toJSON(),
);
// Filter out elements in the manifest that does not comply
// with { kind: foo }
parsedManifest = parsedManifest.filter(r => r && r.kind);
Expand All @@ -184,15 +184,8 @@ export default function AppView() {
if (error && error.constructor === FetchError) {
return <Alert theme="danger">Application not found. Received: {error.message}</Alert>;
}
const {
services,
ingresses,
deployments,
statefulsets,
daemonsets,
secrets,
otherResources,
} = resourceRefs;
const { services, ingresses, deployments, statefulsets, daemonsets, secrets, otherResources } =
resourceRefs;
const icon = get(app, "chart.metadata.icon", placeholder);
return (
<section>
Expand Down
10 changes: 6 additions & 4 deletions dashboard/src/components/Config/AppRepoList/AppRepoForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ it("should not call the install method when the validation fails unless forced",

// So disabling this test for the moment.
await act(async () => {
await (wrapper
.find(CdsButton)
.filterWhere(b => b.html().includes("Install Repo (force)"))
.prop("onClick") as () => Promise<any>)();
await (
wrapper
.find(CdsButton)
.filterWhere(b => b.html().includes("Install Repo (force)"))
.prop("onClick") as () => Promise<any>
)();
});
expect(install).toHaveBeenCalled();
});
Expand Down
10 changes: 3 additions & 7 deletions dashboard/src/components/Config/AppRepoList/AppRepoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,9 @@ function AppRepoList() {
Kube.canI(cluster, "kubeapps.com", "apprepositories", "list", "").then(allowed =>
setCanSetAllNS(allowed),
);
Kube.canI(
kubeappsCluster,
"kubeapps.com",
"apprepositories",
"update",
kubeappsNamespace,
).then(allowed => setCanEditGlobalRepos(allowed));
Kube.canI(kubeappsCluster, "kubeapps.com", "apprepositories", "update", kubeappsNamespace).then(
allowed => setCanEditGlobalRepos(allowed),
);
}, [cluster, kubeappsCluster, kubeappsNamespace]);

const globalRepos: IAppRepository[] = [];
Expand Down
40 changes: 24 additions & 16 deletions dashboard/src/components/Header/ContextSelector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ it("selects a different namespace", () => {
.findWhere(s => s.prop("name") === "namespaces")
.simulate("change", { target: { value: "other" } });
act(() => {
(wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any)();
(
wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any
)();
});
expect(setNamespace).toHaveBeenCalledWith(initialState.clusters.currentCluster, "other");
});
Expand Down Expand Up @@ -177,10 +179,12 @@ it("changes the location with the new namespace", () => {
.findWhere(s => s.prop("name") === "namespaces")
.simulate("change", { target: { value: "other" } });
act(() => {
(wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any)();
(
wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any
)();
});
expect(push).toHaveBeenCalledWith("/c/default-cluster/ns/other/catalog");
});
Expand All @@ -203,10 +207,12 @@ it("changes the location with the new cluster and namespace", () => {
.findWhere(s => s.prop("name") === "namespaces")
.simulate("change", { target: { value: "other" } });
act(() => {
(wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any)();
(
wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any
)();
});
expect(push).toHaveBeenCalledWith("/c/second-cluster/ns/other/catalog");
});
Expand All @@ -225,10 +231,12 @@ it("don't call push if the pathname is not recognized", () => {
.findWhere(s => s.prop("name") === "namespaces")
.simulate("change", { target: { value: "other" } });
act(() => {
(wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any)();
(
wrapper
.find(CdsButton)
.filterWhere(b => b.text() === "Change Context")
.prop("onClick") as any
)();
});
expect(push).not.toHaveBeenCalled();
});
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ it("deletes the resource", async () => {
);

act(() => {
(wrapper
.find(CdsButton)
.filterWhere(b => b.text().includes("Delete"))
.prop("onClick") as any)();
(
wrapper
.find(CdsButton)
.filterWhere(b => b.text().includes("Delete"))
.prop("onClick") as any
)();
});
wrapper.update();
const dialog = wrapper.find(ConfirmDialog);
Expand Down
11 changes: 2 additions & 9 deletions dashboard/src/components/OperatorInstance/OperatorInstance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,8 @@ function OperatorInstance({
services: [],
secrets: [],
} as IAppViewResourceRefs);
const {
services,
ingresses,
deployments,
statefulsets,
daemonsets,
secrets,
otherResources,
} = resourceRefs;
const { services, ingresses, deployments, statefulsets, daemonsets, secrets, otherResources } =
resourceRefs;
const [modalIsOpen, setModalIsOpen] = useState(false);
const closeModal = () => setModalIsOpen(false);
const openModal = () => setModalIsOpen(true);
Expand Down
12 changes: 8 additions & 4 deletions dashboard/src/containers/RoutesContainer/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ const privateRoutes = {
"/c/:cluster/ns/:namespace/apps/:releaseName": AppView,
"/c/:cluster/ns/:namespace/apps/:releaseName/upgrade": AppUpgradeContainer,
"/c/:cluster/ns/:namespace/apps/new/:repo/:id/versions/:version": AppNewContainer,
"/c/:cluster/ns/:namespace/apps/new-from-:global(global)/:repo/:id/versions/:version": AppNewContainer,
"/c/:cluster/ns/:namespace/apps/new-from-:global(global)/:repo/:id/versions/:version":
AppNewContainer,
"/c/:cluster/ns/:namespace/catalog": CatalogContainer,
"/c/:cluster/ns/:namespace/catalog/:repo": CatalogContainer,
"/c/:cluster/ns/:namespace/charts/:repo/:id": ChartViewContainer,
"/c/:cluster/ns/:namespace/:global(global)-charts/:repo/:id": ChartViewContainer,
"/c/:cluster/ns/:namespace/charts/:repo/:id/versions/:version": ChartViewContainer,
"/c/:cluster/ns/:namespace/:global(global)-charts/:repo/:id/versions/:version": ChartViewContainer,
"/c/:cluster/ns/:namespace/:global(global)-charts/:repo/:id/versions/:version":
ChartViewContainer,
"/c/:cluster/ns/:namespace/operators": OperatorsListContainer,
"/c/:cluster/ns/:namespace/operators/:operator": OperatorViewContainer,
"/c/:cluster/ns/:namespace/operators/new/:operator": OperatorNewContainer,
"/c/:cluster/ns/:namespace/operators-instances/new/:csv/:crd": OperatorInstanceCreateContainer,
"/c/:cluster/ns/:namespace/operators-instances/:csv/:crd/:instanceName": OperatorInstanceViewContainer,
"/c/:cluster/ns/:namespace/operators-instances/:csv/:crd/:instanceName/update": OperatorInstanceUpdateContainer,
"/c/:cluster/ns/:namespace/operators-instances/:csv/:crd/:instanceName":
OperatorInstanceViewContainer,
"/c/:cluster/ns/:namespace/operators-instances/:csv/:crd/:instanceName/update":
OperatorInstanceUpdateContainer,
"/c/:cluster/ns/:namespace/config/repos": AppRepoList,
"/docs": ApiDocs,
} as const;
Expand Down
9 changes: 3 additions & 6 deletions dashboard/src/shared/Auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ describe("is403FromAuthProxy", () => {
expect(
Auth.is403FromAuthProxy({
status: 403,
data:
'namespaces is forbidden: User "system:serviceaccount:kubeapps:kubeapps-internal-kubeops" cannot list resource "namespaces" in API group "" at the cluster scope',
data: 'namespaces is forbidden: User "system:serviceaccount:kubeapps:kubeapps-internal-kubeops" cannot list resource "namespaces" in API group "" at the cluster scope',
} as AxiosResponse<any>),
).toBe(false);
});
Expand All @@ -220,8 +219,7 @@ describe("isAnonymous", () => {
expect(
Auth.isAnonymous({
status: 403,
data:
'{"metadata":{},"status":"Failure","message":"selfsubjectaccessreviews.authorization.k8s.io is forbidden: User "system:anonymous" cannot create resource "selfsubjectaccessreviews" in API group "authorization.k8s.io" at the cluster scope","reason":"Forbidden","details":{"group":"authorization.k8s.io","kind":"selfsubjectaccessreviews"},"code":403} {"namespaces":null}',
data: '{"metadata":{},"status":"Failure","message":"selfsubjectaccessreviews.authorization.k8s.io is forbidden: User "system:anonymous" cannot create resource "selfsubjectaccessreviews" in API group "authorization.k8s.io" at the cluster scope","reason":"Forbidden","details":{"group":"authorization.k8s.io","kind":"selfsubjectaccessreviews"},"code":403} {"namespaces":null}',
} as AxiosResponse<any>),
).toBe(true);
});
Expand All @@ -240,8 +238,7 @@ describe("isAnonymous", () => {
expect(
Auth.isAnonymous({
status: 403,
data:
'namespaces is forbidden: User "system:serviceaccount:kubeapps:kubeapps-internal-kubeops" cannot list resource "namespaces" in API group "" at the cluster scope',
data: 'namespaces is forbidden: User "system:serviceaccount:kubeapps:kubeapps-internal-kubeops" cannot list resource "namespaces" in API group "" at the cluster scope',
} as AxiosResponse<any>),
).toBe(false);
});
Expand Down
8 changes: 4 additions & 4 deletions dashboard/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11368,10 +11368,10 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
prettier@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==

pretty-bytes@^5.3.0:
version "5.6.0"
Expand Down

0 comments on commit 4b0120f

Please sign in to comment.