Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting bugs in obj info pages #53

Merged
merged 6 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-proposal-class-properties"
"@babel/plugin-transform-class-properties"
]
}
27 changes: 1 addition & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"dependencies": {
"@axa-fr/react-oidc-context": "^3.1.6",
"@babel/core": "^7.12.10",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-transform-async-to-generator": "^7.12.1",
"@babel/plugin-transform-class-properties": "^7.23.3",
"@babel/preset-env": "^7.12.10",
"@babel/preset-react": "^7.12.10",
"@babel/runtime": "^7.12.5",
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'typeface-roboto';
import "./index.css";
import './i18n.js';
import App from "./js/components/App.jsx";
Expand Down
3 changes: 0 additions & 3 deletions src/js/components/Actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,11 @@ function ConfirmationDialog(props) {
props.handleClose()
setData({...data, acks: [], confirmations: [], action: null})
}
function handleEntering(e) {
}

return (
<Dialog
disableBackdropClick
maxWidth="xs"
onEntering={handleEntering}
onClose={handleCancel}
aria-labelledby="confirmation-dialog-title"
open={props.open}
Expand Down
9 changes: 4 additions & 5 deletions src/js/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
import React from "react";
import ReactDOM from "react-dom";
import {createRoot} from "react-dom/client";
import { useReactOidc } from "@axa-fr/react-oidc-context"
import { useTranslation } from "react-i18next"
import { useStateValue } from '../state.js'
Expand Down Expand Up @@ -241,7 +241,7 @@ function AuthProvider(props) {
return null
}
if ((authChoice == "basic") && (!basicLogin.username || !basicLogin.password)) {
return <Login />
return <Login />
}
if (!authChoice && !oidcUser && location.pathname != "/authentication/callback") {
return <AuthChoice />
Expand Down Expand Up @@ -346,7 +346,6 @@ function AppError(props) {
)
}


const domContainer = document.querySelector('#app');
ReactDOM.render(<App />, domContainer);

const root = createRoot(domContainer)
root.render(<App />)
6 changes: 3 additions & 3 deletions src/js/components/CatalogSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ListItemText from '@mui/material/ListItemText';
import Typography from '@mui/material/Typography';
import useClasses from "../hooks/useClasses.jsx";

const useStyles = theme => ({
const styles = theme => ({
selected: {
cursor: "pointer",
},
Expand All @@ -26,7 +26,7 @@ const useStyles = theme => ({
});

function CatalogSelectorDialog(props) {
const classes = useStyles(useStyles)
const classes = useClasses(styles)
if (!props.options) {
return null
}
Expand Down Expand Up @@ -76,7 +76,7 @@ function CatalogSelector(props) {
if (props.options === undefined) {
return null
}
const classes = useClasses(useStyles)
const classes = useClasses(styles)
const [open, setOpen] = React.useState(false)

function handleClickOpen(e) {
Expand Down
1 change: 1 addition & 0 deletions src/js/components/DeployButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import DialogTitle from "@mui/material/DialogTitle"
import Button from "@mui/material/Button"
import IconButton from "@mui/material/IconButton"
import Tooltip from "@mui/material/Tooltip"
import {useCatalogs} from "../hooks/Catalogs.jsx";

function DeployButton(props) {
const { auth } = useUser()
Expand Down
6 changes: 3 additions & 3 deletions src/js/components/ObjDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ObjMain(props) {
}

function CfgMain(props) {
const classes = styles()
const classes = useClasses(styles)
const sp = splitPath(props.path)
return (
<Grid item xs={12} className={classes.section}>
Expand All @@ -76,7 +76,7 @@ function CfgMain(props) {
}

function UsrMain(props) {
const classes = styles()
const classes = useClasses(styles)
const sp = splitPath(props.path)
return (
<Grid item xs={12} className={classes.section}>
Expand All @@ -88,7 +88,7 @@ function UsrMain(props) {
function SvcMain(props) {
const sp = splitPath(props.path)
const [{ cstat }, dispatch] = useStateValue();
const classes = styles()
const classes = useClasses(styles)

if (cstat.monitor === undefined) {
return null
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/ObjInstanceCounts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ function ObjInstanceCounts(props) {
)
}

export {
export default {
ObjInstanceCounts
}
13 changes: 7 additions & 6 deletions src/js/components/ObjInstances.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import TableRow from '@mui/material/TableRow';
import TableCell from '@mui/material/TableCell';
import Checkbox from '@mui/material/Checkbox';
import useClasses from "../hooks/useClasses.jsx";
import ObjInstanceCounts from "./ObjInstanceCounts.jsx"

const styles = theme => ({
tableWrapper: {
Expand Down Expand Up @@ -114,12 +115,12 @@ function ObjInstances(props) {
<Card className={classes.card}>
<CardHeader
title={t("Instances")}
subheader=<ObjInstanceCounts path={props.path} />
action={
<TableToolbar selected={selected}>
{(selected.length > 0) && <ObjInstanceActions selected={selected} title="" />}
</TableToolbar>
}
subheaderTypographyProps=<ObjInstanceCounts path={props.path} />
action={
<TableToolbar selected={selected}>
{(selected.length > 0) && <ObjInstanceActions selected={selected} title="" />}
</TableToolbar>
}
/>
<CardContent className={classes.content}>
<div className={classes.tableWrapper}>
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/ObjKeyActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ObjKeyActions(props) {
<Actions path={path} title={title} submit={submit} fab={fab}>
<ActionsSection name="dangerous" color="danger" confirms={6}>
<ActionsItem value="delete" text="Delete" requires={{role: "admin", namespace: sp.namespace}}
icon=<DeleteIcon />
icon=<DeleteIcon />
/>
</ActionsSection>
</Actions>
Expand Down
12 changes: 6 additions & 6 deletions src/js/components/ObjKeys.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ function ObjKeys(props) {
setSelected([]);
}
return (
<Card>
<CardHeader
title={t("Keys")}
subheader={props.path}
<Card>
<CardHeader
title={t("Keys")}
subheader={props.path}
action={
<ObjKeyAdd path={props.path} />
}
/>
<CardContent>
/>
<CardContent>
<div className={classes.wrapper}>
<TableToolbar selected={selected}>
{selected.length > 0 ? (
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/ObjKindSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { useStateValue } from '../state.js';
import ToggleButton from '@mui/lab/ToggleButton';
import ToggleButtonGroup from '@mui/lab/ToggleButtonGroup';
import ToggleButton from '@mui/material/ToggleButton';
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord';
import AccountCircleIcon from '@mui/icons-material/AccountCircle';
import LockOpenIcon from '@mui/icons-material/LockOpen';
Expand Down