diff --git a/package.json b/package.json
index 17afcfea9..e6adf4bfb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "juju-dashboard",
- "version": "0.13.2",
+ "version": "0.13.3",
"description": "A dashboard for Juju and JAAS (Juju as a service)",
"bugs": {
"url": "https://github.com/canonical/juju-dashboard/issues"
diff --git a/src/pages/EntityDetails/App/App.tsx b/src/pages/EntityDetails/App/App.tsx
index 48d373f82..90c27c09b 100644
--- a/src/pages/EntityDetails/App/App.tsx
+++ b/src/pages/EntityDetails/App/App.tsx
@@ -23,8 +23,10 @@ import {
getModelMachines,
getModelUnits,
getModelUUIDFromList,
+ isKubernetesModel,
} from "store/juju/selectors";
import { extractRevisionNumber } from "store/juju/utils/models";
+import { useAppSelector } from "store/store";
import {
generateSelectableUnitTableHeaders,
machineTableHeaders,
@@ -63,6 +65,9 @@ export default function App(): JSX.Element {
const units = useSelector(getModelUnits(modelUUID));
const machines = useSelector(getModelMachines(modelUUID));
const modelData = useSelector(getModelInfo(modelUUID));
+ const hideMachines = useAppSelector((state) =>
+ isKubernetesModel(state, modelUUID),
+ );
const canConfigureModel = useCanConfigureModel();
const filteredMachineList = useMemo(() => {
@@ -92,8 +97,6 @@ export default function App(): JSX.Element {
[filteredMachineList, units, modelName, userName],
);
- const hideMachines = modelData?.type === "kubernetes";
-
const unitTableHeaders = useMemo(() => {
const fieldID = "unit-list-select-all";
return generateSelectableUnitTableHeaders(
@@ -307,6 +310,7 @@ export default function App(): JSX.Element {
: "",
}))}
buttonComponent={Link}
+ className="u-sv2"
activeButton={query.tableView}
/>
)}
diff --git a/src/pages/EntityDetails/EntityDetails.tsx b/src/pages/EntityDetails/EntityDetails.tsx
index 9d2f0a879..89b179998 100644
--- a/src/pages/EntityDetails/EntityDetails.tsx
+++ b/src/pages/EntityDetails/EntityDetails.tsx
@@ -21,6 +21,7 @@ import {
getModelInfo,
getModelListLoaded,
getModelUUIDFromList,
+ isKubernetesModel,
} from "store/juju/selectors";
import { useAppSelector } from "store/store";
import urls from "urls";
@@ -51,6 +52,7 @@ const EntityDetails = ({ modelWatcherError }: Props) => {
const modelsLoaded = useAppSelector(getModelListLoaded);
const modelUUID = useSelector(getModelUUIDFromList(modelName, userName));
const modelInfo = useSelector(getModelInfo(modelUUID));
+ const isK8s = useAppSelector((state) => isKubernetesModel(state, modelUUID));
const { isNestedEntityPage } = useEntityDetailsParams();
const isJuju = useSelector(getIsJuju);
@@ -148,7 +150,7 @@ const EntityDetails = ({ modelWatcherError }: Props) => {
});
}
- if (modelInfo?.type !== "kubernetes") {
+ if (!isK8s) {
items.push({
active: activeView === ModelTab.MACHINES,
label: "Machines",
diff --git a/src/pages/EntityDetails/Unit/Unit.tsx b/src/pages/EntityDetails/Unit/Unit.tsx
index 85ff0c9b5..b303ddc2d 100644
--- a/src/pages/EntityDetails/Unit/Unit.tsx
+++ b/src/pages/EntityDetails/Unit/Unit.tsx
@@ -10,12 +10,13 @@ import type { ApplicationData, MachineData } from "juju/types";
import {
getAllModelApplicationStatus,
getModelApplications,
- getModelInfo,
getModelMachines,
getModelUnits,
getModelUUIDFromList,
+ isKubernetesModel,
} from "store/juju/selectors";
import { extractRevisionNumber } from "store/juju/utils/models";
+import { useAppSelector } from "store/store";
import {
generateLocalApplicationTableHeaders,
machineTableHeaders,
@@ -35,7 +36,7 @@ export default function Unit() {
const applications = useSelector(getModelApplications(modelUUID));
const units = useSelector(getModelUnits(modelUUID));
const machines = useSelector(getModelMachines(modelUUID));
- const modelData = useSelector(getModelInfo(modelUUID));
+ const isK8s = useAppSelector((state) => isKubernetesModel(state, modelUUID));
const filteredMachineList = useMemo(() => {
const filteredMachines: MachineData = {};
@@ -102,7 +103,7 @@ export default function Unit() {